By Raj
Part of our Google Workspace Automation guides. Need this built for your team? Hire a Google Apps Script developer.
Estimated reading time: 10 minutes
Automate Google Forms Responses with Apps Script
FormApp edits form structure; SpreadsheetApp handles linked response sheets. onFormSubmit installable trigger fires when respondents submit—route data, notify Slack, create Drive folders.
Validate that trigger is installable From spreadsheet event, not simple trigger—simple cannot call external services.
Combine with approval workflows in /blog/google-sheets-approval-workflow when managers must approve submissions.
onFormSubmit trigger setup
ScriptApp.newTrigger('onFormSubmitHandler').forSpreadsheet(id).onFormSubmit().create() after authorizing.
Handler receives e.values array aligned to form item order—fragile if questions reordered; prefer named keys via e.namedValues when available.
Notifications
MailApp or Slack webhook on each submit for low volume; digest hourly for high volume events.
Include response timestamp and respondent email if Form collects identity.
Route to systems
POST JSON to CRM via UrlFetchApp from mapped fields. Idempotency key = response ID from e.response.getId() if using FormResponse API.
Archive raw JSON to Logging sheet for debugging mapping errors.
Pre-filled URLs
Generate entry.XXXXX prefilled URLs from Sheets for personalized surveys—FormApp API for live forms or string template.
Shorten links with internal URL shortener if needed.
Example code
function onFormSubmitHandler(e) {
const row = e.values;
const email = row[2];
MailApp.sendEmail(email, 'We received your submission', 'Thanks for submitting form row ' + e.range.getRow());
const folder = DriveApp.getFolderById('SUBMISSIONS_FOLDER');
folder.createFile('response-' + e.range.getRow() + '.txt', JSON.stringify(row));
}| Approach | Best for | Tradeoff |
|---|---|---|
| Apps Script native | Google Workspace-centric workflows | 6-min limit, quotas |
| Zapier / Make | No-code, many connectors | Per-task cost, vendor lock-in |
| Python + Cloud | Heavy data / ML | Hosting cost, separate auth |
| Google Workspace automation | Production custom logic | Build cost, you own code |
FAQ
Form in same file as Sheet?
Linked response sheet lives in spreadsheet; trigger binds to that spreadsheet ID.
Edit form items via script?
FormApp.openById(formId).addTextItem() etc.—changes require retesting triggers.
File upload questions?
Uploads land in Drive folder—process file IDs from response with DriveApp.getFileById.
Quiz forms?
FormApp has scoring APIs—special case; most ops use standard forms.
Duplicate trigger fires?
List triggers and delete duplicates—common after copying spreadsheet.
Need this done for you? I handle this as part of my consulting work — fixed-price quote within 24 hours.
Book a call with Raj →Get the full Automate Google Forms Responses with Apps Script script template
I'll email you a production-ready, commented version you can deploy in 10 minutes.
Continue reading
Gmail, Drive & Workspace
Sync Google Calendar to Sheets: Events and Availability
Gmail, Drive & Workspace
Sync Google Calendar with Microsoft Outlook (Apps Script + Graph)
Gmail, Drive & Workspace
Gmail Automation with Google Apps Script: Filters, Labels & Auto-Reply
From another topic
How to Automate Google Sheets with Apps Script (Beginner Guide) →Need help with this? I handle this as part of my Google Workspace Automation service.
Gmail, Drive, Docs, Forms, and Calendar automation.
See how it works →