Get Form Data from Google Docs in an Email Message [Video Tutorial]
Whether you are looking to add a basic “Contact Me” form to your website or need to create a complex online poll with conditional branching, Google Docs is an excellent tool for you. It offers a variety of themes, data can be easily exported and, unlike other polling software, your Google Docs forms can accept any number of responses without the fee.
There’s one limitation though. Google Docs can send email notifications as soon as people submit your online form but, as shown in the above screenshot, there’s no form data included in that email message. You’ll have to open the corresponding Google Docs spreadsheet to see that actual form data which is not always a very convenient option.
From Google Docs Form to your Email Inbox
Should you wish to receive Google Docs form data in an email message as soon as a user submits the form, there’s an easy workaround as explained in the following video.
httpv://www.youtube.com/watch?v=z6klwUxRwQI
The trick is that you associate a send mail routine with your Google Docs form that triggers as soon as a “form submit” action happens. And this routine, written using Google Apps Script, does all the magic – it reads the form values that were just submitted and sends them all in one message to a pre-defined address.
Here’s how you can add email capabilities to your Google Forms step by step:
- Create a new form in Google Docs (or use any of your existing forms) and switch to your Google Docs dashboard. Open the Spreadsheet associated with the Google Form.
- Go to Tools – > Script Editor and choose “Blank Project.” Remove any existing code in the code editor window and copy-paste the following code. Save the project.
- Replace “XYZ” in the code with your own email address where you want to receive the form email notifications.
- From the Resources menu, choose Current Script’s Triggers and set up a new trigger. Replace “On Open” with “On Form Submit” and save the trigger.
- The script with require you to authorize Google Docs to access your Gmail account (for sending email). Just say yes and you’re done.
Advanced users can further customize the script to have custom email subject lines that match one of the form fields. Alternatively, you can specify the form submitter’s email address as the replyto address and thus you can directly respond to the user by replying to that email notification.
0 comments:
Post a Comment