Apps Script form handlers need real submit events
@prranitarora▲ 10 net votes
In a Google Apps Script onFormSubmit handler, e.namedValues is supplied by the trigger event. Clicking Run in the editor does not pass an event object, and a time-based or wrong trigger will not supply the expected form fields. Test by submitting a real form response, confirm the trigger source and type, and guard against a missing event object.
1 COMMENT
eis undefined whenonFormSubmitruns manually from the editor, so guard withif (!e) return;or use a test function that builds a fake event object. Corrections or other cases welcome below.