Respond to feedback

Stay organized with collections Save and categorize content based on your preferences.

Coding level: Beginner
Duration: 15 minutes
Project type: Automation with a custom menu and an event-driven trigger

About this solution

Automatically create draft email replies to feedback from Google Forms. This solution focuses on course feedback from students, but you can apply it to any use case for which you receive feedback via Google Forms.

Form submission responses being sent from Gmail

How it works

The script installs an event-driven trigger that runs each time a user submits a form. With each form submission, the script creates an email draft in Gmail. The email is addressed to the person who submitted the form and includes the form responses and a generic thank-you message. You can edit the email before you send it.

Apps Script services

This solution uses the following services:

  • Script Service: Installs the event-driven trigger that fires when someone submits a form.
  • Spreadsheet Service: Sends the form responses to Gmail.
  • Gmail Service: Creates the email draft with the thank-you message and form responses.

Before you begin

To use this sample, you need the following prerequisites:

  • A Google Account (Google Workspace accounts might require administrator approval)
  • A web browser with access to the internet

Try it

  1. Click the button below to make a copy of the Respond to feedback sample spreadsheet.
    Make a copy
  2. Click Form reply tool > Enable auto draft replies. You might need to refresh the page for this custom menu to appear.
  3. When prompted, authorize the script.
  4. Click Form reply tool > Enable auto draft replies again.
  5. Click Tools > Manage form > Go to live form.
  6. Fill out the form and click Submit.
  7. Open Gmail and check your drafts. You should have a new draft with the form response.

Open the Apps Script project

The sample script's code includes in-line comments to help you understand how it works. To access the code, in the spreadsheet, click Extensions > Apps Script.


This sample was created by Ben Collins, Educator at and Google Developer Expert.

This sample is maintained by Google with the help of Google Developer Experts.