Skip to content

Latest commit

 

History

History

gas-utilities

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

GAS Utilities

A few useful utility methods for Google Apps Script.

Reference

isTriggerInstalled(callbackName)

Checks if Trigger is already installed. Returns true if a trigger with that same callback name is found on the project it was called.

Parameter Type Description
callbackName string The callback name to look for.

Returns: boolean

Examples
Util.isTriggerInstalled('doStuff');
// true

parseConfig(sheet)

Parse sheet as Record<string, string>.

Parameter Type Description
sheet Sheet The sheet to parse.

Returns: Record<string, string>

Examples

Configs sheet:

A B
1 foo bar baz
2 Foo bar baz
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();

const configSheet = spreadsheet.getSheetByName('Configs');

const configParsed = Util.parseConfig(configSheet);

configParsed.foo;
// bar baz
configParsed['Foo bar'];
// baz