Google Forms are a very convenient way to quickly get information into a spreadsheet. Add some Google Script and you can turbo charge that form to send email notifications, generate other data in the spreadsheet, and all those things you might want to do when getting data from a form.
In this section you will learn the basics of getting form information into a Google Script and sending an email depending on a selection from a drop down list in the Google form.
Open up a Google spreadsheet and start creating a form. The example we will use is for routing inquiries to the right department: Sales or Service. Figure 9-1 shows the form editor and the drop down box selection.
After creating the form you can return to the spreadsheet to see the form fields have become columns in the spreadsheet. See Figure 9-2.
Now open the Script Editor (Tools➝Script editor).
You can delete the default function and start the script with global variables (outside any function) that will contain the email addresses for the correct department.
var sales = 'email@example.com'; var service = 'firstname.lastname@example.org'; ...