Ever wished you could get an instant email when someone submits your Google Form complete with their answers and any files they uploaded? With a few lines of Apps Script, you can!
Let’s break it down 🕵️
🧩 Why Use This Script?
This solution answers a common need: getting notified via email when someone submits a form response. Especially useful when:
You're collecting job applications or portfolios.
You want to automate intake notifications.
Your form includes file uploads, and you want the file attached in the email.
Access Apps Script from your Google Forms
Insert the snippet
OnFormSubmit(e) trigger
In my experience, many people aren’t aware that you can actually embed an Apps Script project directly into a Google Forms.
Just like with Google Sheets, you can add custom menus, user interfaces, and powerful automations. Plus, Forms come with their own set of unique triggers you can take advantage of!
This function automatically sends an email to a specified recipient when a form is submitted.
It collects the user's responses and loops through them to build the HTML body of the email.
If a response is of the FILE_UPLOAD type, the script retrieves the uploaded file and includes it as an attachment in the email.
You can check the full list of item types here, and handle each response accordingly!
On your right panel, access the trigger section and click "Add a trigger"
Select the function to launch, here onFormSubmit, and chose the event type "When submitting the form", then save.
Heads up! ⚠️
Before your function can run properly on form submission, you need to authorize the necessary scopes your script uses. To do this, just run any function manually from the script editor, this will trigger the authorization prompt. Approve it, and you're good to go!
You're all set! Want to take it a step further? You could:
Send the email to multiple recipients
Save submissions to a Google Sheet
Enhance the HTML formatting for a more polished look
Plenty of ways to level up from here!