posted 9 Jul 2010, 10:11 by Stephen Hind
updated 11 Apr 2014, 06:43 by Sam Smullen
Go to Google Docs (either http://drive.google.com for a personal account or http://drive.google.com/a/example.com for Google Apps uses, where example.com is your domain)
Use the Create button then choose Form to make a new form
In the form you need to make three required questions
- E-mail Address (so you can get back in touch)
- Message (or whatever you want to call it)
For further information on how to create forms see Forms: Creating Forms - Google Docs Help Centre
In the form editor use View responses button to open the spreadsheet of responses. If cannot see a View responses button use the Choose response destination button and choose to make a new spreadsheet (give it a sensible name) for your responses. Once created the Choose response destination button changes to a View responses button.
- Once in the spreadsheet use the Tools menu, then Script editor...
In the Google Apps Script dialogue box choose to make a Blank Project.
In the Script editor give your script a sensible name, (rather than Untitled project) delete all the existing text and paste in the script below
- Enter your e-mail address in between the quotation marks on the
var recipient = '';
line, so it should now look something like
var recipient = 'email@example.com';
and use the Save button (it's a little icon of a floppy disc)
While still in the Script Editor use the Resources menu, then Current project's triggers...
In the Current Project's Triggers box use the No triggers set up. Click here to add one now link
From the drop-down boxes make sure that contactUsMailer, From spreadsheet and On form submit are selected and use the Save button.
Close the Script Editor and return to your spreadsheet. While you're there save the spreadsheet and close it.
Go to your Google Site and use the Edit Page button, then the Insert menu and then Spreadsheet form
Choose the form you have created and use the Select button, then choose the display options you want for the form (width, height title, border, etc) and then use the Save button
Use the Save button (top-right corner) to save the page and then you can test your form.
I have included the form below, so please do use the form to let me know what you think of the script.
click for larger images
Google Form - Choose response destination
Google Sheets - Tools menu - Script Editor
Google Apps Script - Blank Project
Script Editor with new blank project
Script Editor with pasted script
Resources - Current Project's Triggers Menu
Current Project's Triggers