I have a form submit trigger configured from apps script like this:
The onSubmit
function is this:
function onSubmit(e) {
console.log("Form submitted", JSON.stringify(e.namedValues));
console.log("Form submitted", JSON.stringify(e));
}
But whenever I submit the form, the trigger does get fired and function runs. But e.namedValues
is undefined.
What could be wrong? (I have linked a spreadsheet to the form which also did not change the outcome).
2
Answers
The source should be from Spreadsheet.
There is no namedValues on the trigger for the form.
Google Forms: Retrieve Responses Automatically
This sample script allows you to retrieve responses submitted to your Google Form automatically in the
Executions
tab of Google Apps Script.The sample form looks like this:
OUTPUT
REFERENCE
Class Form
Class FormResponse