AI-generated Key Takeaways
-
FormTriggerBuilder helps in creating custom triggers for Google Forms.
-
It offers methods to set triggers for form submission (
onFormSubmit()
) and form opening (onOpen()
). -
create()
method finalizes and returns the new trigger. -
Triggers execute specified functions (
myFunction
in the examples) when the defined event (submit or open) occurs.
A builder for form triggers.
Methods
Method | Return type | Brief description |
---|---|---|
create() | Trigger | Creates and returns the new trigger. |
on | Form | Specifies a trigger that will fire when a response is submitted to the form. |
on | Form | Specifies a trigger that will fire when the form's edit view is opened. |
Detailed documentation
create()
onFormSubmit()
Specifies a trigger that will fire when a response is submitted to the form.
const form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); ScriptApp.newTrigger('myFunction').forForm(form).onFormSubmit().create();
Return
Form
— this Form
, for chaining
onOpen()
Specifies a trigger that will fire when the form's edit view is opened.
const form = FormApp.getActiveForm(); ScriptApp.newTrigger('myFunction').forForm(form).onOpen().create();
Return
Form
— This Form
, for chaining.