• Home
  • Systems
  • Networking
  • WordPress
  • Web
  • Geekery

Analysis and Review

Receive Google Forms Data Via Email

June 23, 2014 by Kurt Turner

Step 1: Launch Google Drive

Step 2: Create a Google form

All entries from this form will go to a google spreadsheet

Step 3: Go to the spreadsheet where form entries will populate and click tools -> script editor. Choose to create new script. Paste script from below into the provided area. Save.

Step 4: From within the area you created the script choose: Resources -> Triggers -> Add new trigger. Choose “SendGoogleFormViaEmail” from the run column. The other options are self explanatory.  This trigger will send you an email with the form fills each time the form is updated.

[code]
function Initialize() {
var triggers = ScriptApp.getScriptTriggers();
for(var i in triggers) {
ScriptApp.deleteTrigger(triggers[i]);
}
ScriptApp.newTrigger("SendGoogleFormViaEmail")
.forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())
.onFormSubmit()
.create();
}
function SendGoogleFormViaEmail(e)
{
try
{
// You may replace this with another email address: var email = "yourmail@domain.com";
var email = Session.getActiveUser().getEmail();
// change the below var to the desired subject
var subject = "Google Docs Form Via Email";
var s = SpreadsheetApp.getActiveSheet();
var columns = s.getRange(1,1,1,s.getLastColumn()).getValues()[0];
var message = "";
// Only include form fields that are not blank
for ( var keys in columns ) {
var key = columns[keys];
if ( e.namedValues[key] && (e.namedValues[key] != "") ) {
message += key + ‘ :: ‘+ e.namedValues[key] + "\n\n";
}
}
// This is the MailApp service of Google Apps Script
MailApp.sendEmail(email, subject, message);
} catch (e) {
Logger.log(e.toString());
}
}[/code]

Filed Under: Web

Latest and Greatest

Apache vs Nginx for WordPress

Certbot Lets Encrypt And WordPress MU Multi-Site

How To Find and Replace Multiple File in MS Word

How To Get Stretch Res on Windows 10 AMD Radeon For Game Play

This is the ASUS Chromebox we've been running for 2 years as our "brain" for our home grown digital display kiosk.

DIY Digital Signage Bulletin Board or Kiosk

© Copyright Analysis And Review · All Rights Reserved ·