'Google App Script on form submit trigger: deployed in the spreadsheet vs deployed in the form
Intuitively, I set a on form submit
function in the form's script editor and set the trigger accordingly.
function onSubmit(e) {
console.log(e);
}
The response
is empty.
I then move this function to the corresponding spreadsheet's code editor and set the trigger, and it works this time. The event object is just like what it says on https://developers.google.com/apps-script/guides/triggers/events?hl=en#form-submit
So why does this trigger has to be in the spreadsheet? And for the form, the function gets executed when someone submits their response, so the trigger was set right, why then the event object doesn't contain the response?
Solution 1:[1]
The e.response
object is an instance of the FormResponse class. To inspect its contents, use the methods listed in the reference.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | doubleunary |