People use Google forms as a quick way to see and manage responses, create online forms and surveys or get answers to questions etc. In this lesson you will learn how to get actual data of inquiry other than just notification when someone fills your form.
There are two ways to receive form data in your email:
- Easy Way – By using a chrome addon
- Less Easy Way – By using a code snippet
Using Google Chrome Addon, ‘Email Notifications for Forms’
- Install the Email Notifications for Forms, a Google Forms add-on. Once installed, click its puzzle shape icon in the Forms Editor and select the Email Notification for Form menu followed by clicking the Create New Rule menu.
- This will open the configuration settings screen in the form editor. Now you will need to enter your full name i.e. used as the sender’s name and specify the list of comma separated email(s) addresses whom you want to receive the email notifications for submitted forms.
- Also you can send an auto-confirmation email to the respondent of your form when they submit the form, simply tick the Notify Submitter checkbox.
- Select the question in your Google Form which is asked for the respondent’s email address.
- Now move to the next screen and fill in the subject line, message body of the email notification. It allows you to customize emails and include the {{form fields}} with in the subject line or body. For instance:
- {{Form Name}} is replaced by name (title) of your Google Form
- {{Form Url}} is replaced with direct link to edit a user’s response
- {{Response Number}} is replaced with current number of form entry
- {{All Answers}} is replaced with full response which is formatted as a table
- Finally, click the Create Rule button in-order to activate the form notification.
That’s all with configuration. Now you can test the work by opening your Google Form and submitting a new entry. If all done right, you will see the email notification in your Gmail’s sent items directory.
Using Script
You can also make use of the following code (source) in your script editor to get Google forms data in your email message. Start by clicking spreadsheet -> tools -> script editor and copy-paste following code:
function sendFormByEmail(e)
{
var email = "yourname@email.com";
var txt = "";
for(var field in e.namedValues) {
txt += field + ' :: ' + e.namedValues[field].toString() + "\n\n";
}
MailApp.sendEmail (email, "Your Subject goes here ", txt);
}
Now save the code -> resource > current projects triggers -> renaming the project with the name you want. Click no trigger set up; followed by ‘click here’ to add. Select events from spreadsheet, on form submit -> click save. It will prompt you to authorize and save changes.
Now in-case you want to send email to more than one email address then simply add more emails in place of just yourname@email.com like this “name@email.com, name1@email.com, … etc”. You can also edit the subject line to whatever you want.