Skip to content

Task guide

Respond to a Google Form submission

Add a small response function, then install a form-submit trigger so each new answer produces a private email summary.

1 · Prepare

Put these pieces in place

  • Open the Apps Script project attached to the Google Form.
  • Use a form with at least one question so each response has something to summarize.
  • Choose an owner account that can receive the notification email.

Change these values

Change these values

Make the code yours before you run it.
Email subject
New form response

This is the subject in the notification email.

2 · Review before running

What the script can access and change

Permissions you approve

  • Read submitted responses from the attached Google Form.
  • Send a notification email from the script owner account.

Effects of one run

  • Sends one private summary email after each new Form submission.
  • Does not change or remove Form responses.

3 · Copy

Paste this into the Apps Script editor

Create or open a script file, replace the example values marked above, then save the project.

Code.gs
const EMAIL_SUBJECT = 'New form response'; // This is the subject in the notification email.

/** @param {Events.FormsOnFormSubmit} event */
function emailFormSummary(event) {
  const response = event.response;
  const answers = response.getItemResponses().map((itemResponse) => {
    return itemResponse.getItem().getTitle() + ': ' + itemResponse.getResponse();
  });
  const message = answers.length ? answers.join('\n') : 'A form response was received with no answers.';
  const recipient = Session.getEffectiveUser().getEmail();

  GmailApp.sendEmail(recipient, EMAIL_SUBJECT, message);
}

4 · Run safely

Follow these steps in order

  1. Add the response function

    In the Form’s Apps Script project, paste the function and save it. Do not run it from the editor because it needs a real submission.

  2. Install the trigger

    Open Triggers, choose Add Trigger, select emailFormSummary, then choose From form and On form submit.

  3. Send a practice response

    Submit the Form once yourself and check the script owner’s inbox for the summary.

5 · Confirm

How to tell it worked

A newly submitted response produces an email showing each question and its submitted answer.

If the result is different

Troubleshooting

Running the function from the editor fails.
That is expected because no form response event is present there. Test it by submitting the Form after installing the trigger.
No email arrives after a test submission.
Check that the trigger is From form and On form submit, and confirm the script owner has approved the requested permissions.

Technical details

Names used in this script

Open these details when you want to adapt the example or look up an exact service or method name.

Show Apps Script symbols and service pages

Keep going