Google Forms and Twilio integrate through Google Apps Script bound to your form, calling the Twilio Messages API whenever a new response is submitted to send an SMS confirmation to the respondent and an alert to your team, bridging the gap between Google's lightweight form tool and real-time SMS communication. This integration is used by educators collecting student phone numbers, HR teams running onboarding surveys, and small businesses capturing lead inquiries via Google Forms who want immediate SMS follow-up rather than waiting for email to be opened. The setup involves writing a brief Apps Script function that fires on the Google Forms onFormSubmit trigger, extracts the respondent's phone from the form response, and calls the Twilio REST API to dispatch the SMS.
What You Need Before You Start
Open the Apps Script editor attached to your Google Form by clicking the three-dot menu in your Google Form editor and selecting Script Editor, which opens a script project bound to that specific form and has direct access to the FormApp service. Store your Twilio Account SID, Auth Token, and From Number as Apps Script Script Properties by navigating to Project Settings, then Script Properties, and adding TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN, and TWILIO_FROM_NUMBER entries, retrieving them in your script using PropertiesService.getScriptProperties().getProperty('TWILIO_ACCOUNT_SID'). Add a Short Answer question to your Google Form asking for the respondent's phone number with a title such as Mobile Phone Number, and note the exact question title as Apps Script retrieves form responses by matching the question title string. From Twilio, provision an SMS-capable phone number and collect your Account SID and Auth Token, and ensure A2P 10DLC registration is complete in the Twilio Console before enabling customer-facing SMS to US numbers.
Step-by-Step Integration Guide
Write the Apps Script function as follows: function onFormSubmit(e) { var responses = e.response.getItemResponses(); var phone = ''; for (var i = 0; i < responses.length; i++) { if (responses[i].getItem().getTitle() === 'Mobile Phone Number') { phone = responses[i].getResponse(); break; } } if (!phone) return; var accountSid = PropertiesService.getScriptProperties().getProperty('TWILIO_ACCOUNT_SID'); var authToken = PropertiesService.getScriptProperties().getProperty('TWILIO_AUTH_TOKEN'); var fromNumber = PropertiesService.getScriptProperties().getProperty('TWILIO_FROM_NUMBER'); var toNumber = phone.replace(/[^0-9+]/g, ''); var payload = 'To=' + encodeURIComponent(toNumber) + '&From=' + encodeURIComponent(fromNumber) + '&Body=' + encodeURIComponent('Thank you for your submission. We will be in touch shortly.'); var options = { method: 'post', headers: { Authorization: 'Basic ' + Utilities.base64Encode(accountSid + ':' + authToken) }, payload: payload }; UrlFetchApp.fetch('https://api.twilio.com/2010-04-01/Accounts/' + accountSid + '/Messages.json', options); }. Set up the trigger by running the setup function: ScriptApp.newTrigger('onFormSubmit').forForm(FormApp.getActiveForm()).onFormSubmit().create() once, which attaches the SMS function to the form's submit event permanently. Test the trigger by submitting a test response with a real mobile phone number and verify that Twilio Console shows the dispatched message in the message log within seconds of submission.
Common Issues and How to Fix Them
The Apps Script onFormSubmit trigger does not fire when a form response is edited after initial submission because Google Forms triggers fire only on new submissions, not edits, causing any changes the respondent makes to their response to not trigger a follow-up SMS. Add a note in your form confirmation message informing respondents that the SMS confirmation was sent to the phone they provided and to contact you directly if they need to update their information. Apps Script execution errors in the onFormSubmit function prevent the SMS from being sent but also do not surface any visible error to the form respondent, making it difficult to detect failures. Add error handling with a try-catch block around the UrlFetchApp.fetch call and send a notification email to the form owner using MailApp.sendEmail when the Twilio call fails, including the error message and the respondent's email if available, so failures do not go undetected. Google Apps Script has a daily trigger execution quota of 90 minutes of total execution time for free accounts, and high-volume forms receiving hundreds of submissions per day may exhaust this quota, causing triggers to stop firing. Upgrade to a Google Workspace account which provides a higher quota, or implement batching by collecting responses in a Google Sheet and running a single time-based trigger every 5 minutes that processes pending SMS in bulk rather than firing once per submission.
How to Get More from This Integration
Build a lead routing SMS system by reading additional form fields such as the Industry or Service Interest question and using conditional logic in the Apps Script to dispatch the internal alert SMS to different team member phone numbers based on the respondent's answers, routing sales leads to the sales team and support inquiries to the support team. Add a confirmation SMS with a personalized message by reading the respondent's name from the Name question in the form response and composing the Body string as 'Hi ' + name + ', we received your request and will contact you within 24 hours. Reference number: ' + e.response.getId() so the respondent has a reference ID to quote in follow-up communications. Sync form submissions to a Google Sheet simultaneously with the SMS send by using the Spreadsheet service in the same Apps Script to append each response as a row in a designated Google Sheet, creating a complete log of all form submissions with their SMS send status that you can review and re-trigger manually if needed. Create a multi-step follow-up sequence by storing the respondent's phone and submission timestamp in a Google Sheet row from the Apps Script, then creating a separate time-based trigger that runs daily and checks for rows where the submission was more than 24 hours ago with no follow-up SMS sent, dispatching a Twilio follow-up SMS and marking the row as followed_up to prevent repeated sends.
Conclusion
Google Forms and Twilio together enable instant SMS confirmation and team alerting for every form submission without any additional software beyond a few lines of Apps Script. Contact Telphi Consulting to build and configure a Google Forms Twilio SMS integration for your organization.
Ready to Transform Your Business Communications?
Get a free consultation with our VoIP experts and discover how we can help you save costs, improve efficiency, and scale your business.
Comments (0)
Join the discussion and share your thoughts (AI-moderated for quality)
Be the first to comment
No comments yet. Share your thoughts below.