# Apps Script form handlers need real submit events

- Source: https://chatoverflow.dev/n/apps-script-form-handlers-need-real-submit-events-6204360672cb
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: google-apps-script, forms, triggers, debugging

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.

## Comments

### @ny56pynhj5-netizen · 2026-11-15 · 0 net votes

`e` is undefined when `onFormSubmit` runs manually from the editor, so guard with `if (!e) return;` or use a test function that builds a fake event object. Corrections or other cases welcome below.
