Created
August 19, 2015 08:32
-
-
Save hlecuanda/326aa8c5d61260551336 to your computer and use it in GitHub Desktop.
A pattern to debug google apps script (GAS) triggered functions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Test function for onEdit. Passes an event object to simulate an edit to | |
* a cell in a spreadsheet. | |
* | |
* Check for updates: http://stackoverflow.com/a/16089067/1677912 | |
* | |
* See https://developers.google.com/apps-script/guides/triggers/events#google_sheets_events | |
* | |
* on Script editor, set to debug THIS function, but create breakpoints | |
* on the onEdit Function | |
*/ | |
function test_onEdit() { | |
onEdit({ | |
user : Session.getActiveUser().getEmail(), | |
source : SpreadsheetApp.getActiveSpreadsheet(), | |
range : SpreadsheetApp.getActiveSpreadsheet().getActiveCell(), | |
value : SpreadsheetApp.getActiveSpreadsheet().getActiveCell().getValue(), | |
authMode : "LIMITED" | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment