AI-generated Key Takeaways
-
SpreadsheetTriggerBuilder is a builder used to create triggers for spreadsheets.
-
You can create triggers that fire on changes, edits, form submissions, or when the spreadsheet is opened.
-
The
create()method finalizes and returns the trigger. -
Methods like
onChange(),onEdit(),onFormSubmit(), andonOpen()return the builder for method chaining.
Builder for spreadsheet triggers.
Methods
| Method | Return type | Brief description |
|---|---|---|
Trigger
|
Creates the trigger and returns it. | |
Spreadsheet
|
Specifies a trigger that will fire when the spreadsheet's content or structure is changed. | |
Spreadsheet
|
Specifies a trigger that will fire when the spreadsheet is edited. | |
Spreadsheet
|
Specifies a trigger that will fire when the spreadsheet has a form submitted to it. | |
Spreadsheet
|
Specifies a trigger that will fire when the spreadsheet is opened. |
Detailed documentation
create()
on
Change()
Specifies a trigger that will fire when the spreadsheet's content or structure is changed.
const sheet = SpreadsheetApp . getActive (); ScriptApp . newTrigger ( 'myFunction' ). forSpreadsheet ( sheet ). onChange (). create ();
Return
Spreadsheet
— a builder for chaining
on
Edit()
Specifies a trigger that will fire when the spreadsheet is edited.
const sheet = SpreadsheetApp . getActive (); ScriptApp . newTrigger ( 'myFunction' ). forSpreadsheet ( sheet ). onEdit (). create ();
Return
Spreadsheet
— a builder for chaining
on
Form
Submit()
Specifies a trigger that will fire when the spreadsheet has a form submitted to it.
const sheet = SpreadsheetApp . getActive (); ScriptApp . newTrigger ( 'myFunction' ) . forSpreadsheet ( sheet ) . onFormSubmit () . create ();
Return
Spreadsheet
— A builder for chaining.
on
Open()
Specifies a trigger that will fire when the spreadsheet is opened.
const sheet = SpreadsheetApp . getActive (); ScriptApp . newTrigger ( 'myFunction' ). forSpreadsheet ( sheet ). onOpen (). create ();
Return
Spreadsheet
— a builder for chaining

