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.
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
- Click the button below to make a copy of the Respond to feedback sample
Make a copy
- Click Form reply tool > Enable auto draft replies. You might need to refresh the page for this custom menu to appear.
- When prompted, authorize the script.
- Click Form reply tool > Enable auto draft replies again.
- Click Tools > Manage form > Go to live form.
- Fill out the form and click Submit.
- 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 benlcollins.com and Google Developer Expert.
This sample is maintained by Google with the help of Google Developer Experts.