A few useful utility methods for Google Apps Script.
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
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