How to Send an Email Based on a Google Forms Answer
Quick answer: Google Forms' own setting, Get email notifications for new responses, only tells you that a response arrived, and only to the account that turned it on. To email a different person depending on an answer, attach a short Apps Script to the form, read the answer with e.response.getItemResponses(), pick the address from a lookup table and send with MailApp.sendEmail, all on an installable On form submit trigger. Free Gmail accounts can email 100 recipients a day this way. Without code, Zapier does it with a Filter step, which needs a paid plan.
A contact form where sales questions should reach sales and support questions should reach support. A time-off request that should go to whichever manager the employee picked. A feedback survey where nobody wants an email for every five-star rating, but everyone wants to hear about a one-star. These all need the same thing: an email whose recipient depends on what the respondent answered.
Google Forms doesn't do this, but a 25-line Apps Script does, for free and without any third party seeing your responses. This guide gives you the script, explains every permission it asks for, shows how to test it and find errors, lists the sending limits, and covers the no-code route through Zapier. FormMaker, which publishes this guide, is an independent app that creates real Google Forms in your Google account; it isn't affiliated with Google, and the steps work on any Google Form.
If you build forms often, a Google Forms AI builder handles the first draft so your time goes into checking and sharing it.
What Google Forms sends on its own
There are two built-in emails, and neither one routes by answer:
| Built-in email | Where to turn it on | Who gets it | Can it depend on an answer? |
|---|---|---|---|
| New response notification | Responses tab, More (three dots), Get email notifications for new responses | The account that turned it on | No |
| Copy of the response | Settings, Responses, Send responders a copy of their response | The person who filled in the form | No |
The notification is a short alert with a link to the responses; you can't change its recipient, its text or when it's sent. Our guide to response notification emails covers it, along with Google Sheets' notification rules for a daily digest. The respondent's copy is covered in sending respondents a copy of their answers. Google's help page on viewing and managing form responses also points to a Marketplace add-on for more notification options; the script below does the routing part without one.
If one of those already covers what you need, stop here. Conditional routing is worth setting up when the wrong person reading an email, or nobody reading it, actually costs you something.
Before you write any code: make the answer easy to match
The script compares the respondent's answer with a list you write. That only works if the answer comes from a fixed set of options.
- Use a multiple choice or dropdown question for the routing answer. A free-text answer breaks the moment someone types "sales dept" instead of "Sales". See dropdown vs multiple choice for which fits your list.
- Make it required. Otherwise some responses have nothing to route on. The script below still sends those to a fallback address, so nothing is lost.
- Don't add the "Other" option to the routing question. Anything typed there won't match your list and will land in the fallback inbox.
- Settle the wording now. The script matches the question title and the option text exactly, including capitals and punctuation. Changing "Support" to "Technical support" later means changing the script too.
The script: route each response to the right inbox
Step 1: open the form's script editor
Open the form in the editor, click the three-dot More menu at the top right and choose Apps Script. A new tab opens with a project attached to this form and an empty myFunction. This has to be the form's own script, not one opened from the response spreadsheet: the code below reads e.response, which only a form's submit trigger provides. Our Apps Script guide for Google Forms explains the difference between the two kinds of script.
Step 2: paste the code
Replace everything in the editor with this, then change the question title, options and addresses to match your form:
// The question that decides where the email goes, and an address per answer.
const ROUTING_QUESTION = 'What do you need help with?';
const ROUTES = {
'Sales': '[email protected]',
'Support': '[email protected]',
'Billing': '[email protected], [email protected]'
};
const FALLBACK = '[email protected]'; // no answer, or an answer not listed
function routeResponse(e) {
const form = FormApp.getActiveForm();
let topic = '';
const lines = e.response.getItemResponses().map(r => {
const title = r.getItem().getTitle();
const answer = r.getResponse();
if (title === ROUTING_QUESTION) topic = answer;
return title + ': ' + (Array.isArray(answer) ? answer.join(', ') : answer);
});
const message = {
to: ROUTES[topic] || FALLBACK,
subject: form.getTitle() + ': ' + (topic || 'new response'),
body: lines.join('\n')
};
const respondent = e.response.getRespondentEmail();
if (respondent) message.replyTo = respondent;
MailApp.sendEmail(message);
}
// Re-sends the most recent response through routeResponse, for testing.
function testWithLastResponse() {
const responses = FormApp.getActiveForm().getResponses();
routeResponse({ response: responses[responses.length - 1] });
}
Save with Ctrl+S (Cmd+S on a Mac). Here's what it does, line by line in plain terms:
ROUTESis the lookup table: each answer on the left, the address (or comma-separated addresses) on the right. Add as many rows as your question has options.e.response.getItemResponses()returns every answered question in form order. For each one the script records "Question: answer" for the email body, and remembers the answer to the routing question.- Checkbox and grid questions return a list of answers rather than one; the
Array.isArraycheck joins those with commas so the email stays readable. ROUTES[topic] || FALLBACKpicks the address. If the routing question was skipped or the answer isn't in the table, the email goes to the fallback.getRespondentEmail()returns the respondent's address only when the form collects email addresses (Settings, Responses, Collect email addresses). When it does, the script sets it as the reply-to, so whoever receives the email can simply press Reply.MailApp.sendEmail(message)sends a plain-text email from the account that owns the trigger.
Step 3: add the On form submit trigger
The code does nothing until a trigger runs it. In the script editor's left sidebar, click the clock icon (Triggers), then Add Trigger at the bottom right, and set:
- Choose which function to run:
routeResponse - Choose which deployment should run: Head
- Select event source: From form
- Select event type: On form submit
- Failure notification settings: Notify me immediately while you're setting it up (you can switch to daily later)
Click Save. Google now asks for permission, because the trigger will run the script for you whenever someone submits.
Step 4: the permission screens, explained
- Choose an account. Pick the Google account that owns the form. The emails will be sent from this account, and count against its daily limit.
- "Google hasn't verified this app." You'll see this for any script you write yourself, because Google hasn't reviewed this project. It doesn't mean the code is harmful. Click Advanced, then Go to (your project name) (unsafe). Do this only for code you've read and understood; the code above calls nothing outside Google.
- The permission list. Apps Script derives it from the code:
- A Forms permission (to view and manage your forms, or the form the script is attached to), because
FormApp.getActiveForm()reads the form's title and the submitted answers. - Send email as you, because
MailApp.sendEmailsends from your account. This is the one people hesitate over, and it's the whole point of the script. MailApp can only send; it can't read your inbox.
ScriptApp.newTriggerinstead of the Triggers page, you'll also see Allow this application to run when you are not present. If the screen offers a checkbox per permission, tick all of them; the script fails on any you leave out. - A Forms permission (to view and manage your forms, or the form the script is attached to), because
- Click Continue. The trigger appears in the list.
The project's Overview page lists everything it was granted under "Project OAuth Scopes", so you can check later what a script attached to your form is allowed to do.
How to test it, and where errors show up
Don't test by clicking Run with routeResponse selected. Run gives the function no event, so e is undefined and you'll get an error about reading response of undefined. That error only means the test was wrong, not the script. Test one of these two ways instead:
- Submit the live form. Open the respondent link in a private window and send one response for each routing option, using answers you'll recognize ("TEST Sales", "TEST Support"). Check each inbox, including spam.
- Replay the last response. Choose
testWithLastResponsein the function menu and click Run. It feeds the most recent real response intorouteResponse, which is handy for adjusting the email text without filling in the form again and again.
Then open Executions in the left sidebar of the script editor. Every run is listed there, whether a trigger or you started it, with its status. A failed run shows the error message and the line number when you click it. Typical ones:
- An invalid email error: a typo in an address in
ROUTESorFALLBACK. - A "service invoked too many times" error: the account has hit its daily email limit (next section).
- Emails all go to the fallback: no error, but the question title or an option in
ROUTESdoesn't match the form exactly. Addconsole.log(topic);beforeMailApp.sendEmail, submit again and read the logged value in Executions. - No run listed at all: the trigger is missing, points at a different function, or was created on another copy of the form. Check the Triggers page. Copying a form copies its script, but not its triggers.
When everything works, delete the test responses from the Responses tab so they don't skew your results. Keep failure notifications on: a trigger that fails silently for a week means a week of requests nobody saw.
Variations for common forms
Several recipients from a checkbox question
A volunteer form where people tick the teams they're interested in should email every matching coordinator. Replace the topic logic with a set of addresses:
const to = new Set();
// inside the map(), instead of "if (title === ROUTING_QUESTION) topic = answer;"
if (title === ROUTING_QUESTION) {
[].concat(answer).forEach(a => { if (ROUTES[a]) to.add(ROUTES[a]); });
}
// when building the message:
to: to.size ? [...to].join(',') : FALLBACK,
Each address counts separately toward the daily limit, so a response that ticks four teams uses four of it.
Alert only on a low rating
For a feedback survey, skip the email unless the score needs attention. With a 1-to-5 linear scale titled "Overall rating", the answer arrives as text such as "2":
let rating = null;
// inside the map():
if (title === 'Overall rating') rating = Number(answer);
// after the map(), before sending:
if (rating === null || rating > 2) return; // only 1s and 2s send an email
Route to the manager the respondent picked
On a time-off or work request form, make "Your manager" a dropdown of names and map each name to an address in ROUTES. When managers change, you edit the table and the dropdown together. If the list is long or changes often, fill the dropdown from a spreadsheet, as described in populating a Google Forms dropdown from a Google Sheet, and keep the addresses in the same sheet. Our HR onboarding and PTO forms guide covers what else such a form should ask.
Copy someone on every email
Add cc: '[email protected]' to the message object. MailApp also accepts bcc, name (the sender name shown in the inbox) and htmlBody for a formatted email. CC'd addresses count toward the daily limit too.
Sending limits: how many emails a day
Apps Script counts email recipients, not emails, per account per day. As of November 2026, Google's Apps Script quotas page lists:
| Limit | Free Google account (gmail.com) | Google Workspace account |
|---|---|---|
| Email recipients per day (MailApp) | 100 | 1,500 |
| Recipients per message | 50 | 50 |
| Total trigger runtime per day | 90 minutes | 6 hours |
| Script runtime per execution | 6 minutes | 6 minutes |
| Triggers per user per script | 20 | 20 |
Google notes that quotas are per user and reset 24 hours after the first request, and that when one is exceeded the script throws an exception and stops, so the email for that response simply isn't sent. Each routed email here is a single recipient unless you list several addresses or add CCs, so a free account can route roughly 100 responses a day. That's plenty for a contact or request form, and not enough for a registration form that opens to a whole school district on one morning.
If you're close to the limit, check what's left from inside the script with MailApp.getRemainingDailyQuota(), send a daily digest instead of one email per response (a time-driven trigger that collects the day's answers), or run the trigger from a Workspace account. The limit belongs to whoever created the trigger, not the form owner, which is one more reason to create it from a shared role account on a team form.
The no-code route: Zapier with a filter
If writing code isn't an option, Zapier can do the same routing. Each route is its own Zap:
- Trigger: the Google Forms app, event New Form Response. Connect your Google account and pick the form. (The older route, Google Sheets New Spreadsheet Row on the form's linked response sheet, works too.)
- Filter: add a Filter step and set the rule Only continue if the routing question's field exactly matches "Sales".
- Action: Gmail Send Email to the sales address, mapping the answers into the body.
- Test the Zap with a real submission, turn it on, then duplicate it and change the filter value and recipient for "Support", "Billing" and so on. On paid plans, Paths can put all the branches in one Zap.
The catch is the plan. As of November 2026, Zapier's help center says Filter isn't available on the Free plan, and its pricing page limits Free to two-step Zaps checked every 15 minutes, with 100 tasks a month. Filters and Paths start on the Professional plan, listed from $19.99 a month billed annually, which checks for new data every 2 minutes. A Zap with no filter on the Free plan can still send one email per response to one fixed address, which the built-in notification already does for free.
Zapier is the better choice when the destination isn't just email: a Slack channel per team, a row in a CRM, a task in a project tool. Your responses then pass through Zapier as well as Google, so check that your school or company allows that. Setup details are in our Google Forms and Zapier guide, and the chat versions in Google Forms and Slack and Google Forms and Microsoft Teams.
Script or Zapier?
| Apps Script | Zapier with a filter | |
|---|---|---|
| Cost | Free with any Google account | Paid plan needed for filters |
| Speed | Seconds after the submission | Every 2 minutes on Professional |
| Daily volume | 100 recipients (free account) or 1,500 (Workspace) | Your plan's monthly task allowance |
| Who sees the responses | Only Google | Google and Zapier |
| Setup | Paste code, add one trigger | Point and click, one Zap per route |
| Other destinations | Possible, but you write the code | Thousands of apps |
Keep it running, and keep it private
- The trigger belongs to one person. Installable triggers always run under the account that created them, so the emails come from that person's address. If they leave and their account is suspended, routing stops. Create the trigger from an account that will outlast any one employee, and read transferring form ownership before someone hands a form over.
- Other editors can't see your trigger. A collaborator opening the Triggers page sees only their own triggers, so they may think there's no automation and add a second one, and every email then arrives twice. Note in the form description, or a comment at the top of the script, who owns the trigger. Our collaborators guide covers who can change what.
- The email body copies the answers. Every inbox the email reaches now holds a copy of the response. For health details, ID numbers or anything personal, send only the routing answer and the respondent's name, and read the rest in the response sheet. Our data privacy guide has more (general information, not legal advice).
- Edits to the form need edits to the script. Renaming the routing question, or an option, quietly sends everything to the fallback. After any change to the form, submit one test response and check Executions.
For a complete contact form to route, our website contact form guide covers the questions and the embed.
Frequently asked questions
Can Google Forms send an email to different people based on an answer?
Not with its built-in settings. Get email notifications for new responses only alerts the account that turned it on, and the respondent copy only goes to the respondent. Routing by answer needs an Apps Script with an On form submit trigger, or a tool such as Zapier with a filter.
Where is the built-in Google Forms notification setting?
Open the form, click the Responses tab, click More (the three dots) and choose Get email notifications for new responses. It sends a short alert with a link to the responses to the account that turned it on.
How many emails can Apps Script send per day?
As of November 2026, Google's Apps Script quotas page lists 100 email recipients a day for free Google accounts and 1,500 for Google Workspace accounts, with up to 50 recipients per message. The quota counts recipients, so CC addresses count too, and it belongs to the account that created the trigger.
Why does my script say e is undefined?
You ran the trigger function with the Run button, which passes no event. Test by submitting the live form, or run a helper that passes the most recent response to the function, then check the result on the Executions page.
Where do I see if the script failed?
Open the script editor and click Executions in the left sidebar. Each run is listed with its status, and a failed run shows the error message and line number. Setting the trigger's failure notifications to Notify me immediately also emails you when a run fails.
Why do all my emails go to the fallback address?
The question title or the option text in the script doesn't exactly match the form, including capitals and punctuation, or the routing question was skipped. Log the matched value with console.log and compare it with the form.
Can I route Google Forms responses without code?
Yes, with Zapier: a Google Forms New Form Response trigger, a Filter step that only continues if the answer exactly matches a value, and a Gmail Send Email action, one Zap per route. As of November 2026, Zapier's Filter step is not available on its Free plan.
Does the email come from my address?
Yes. MailApp sends from the account that created the trigger. If the form collects email addresses, the script can set the respondent's address as the reply-to, so pressing Reply answers the respondent.