Created
November 9, 2012 19:51
-
-
Save sauntimo/4047814 to your computer and use it in GitHub Desktop.
Looping through Object Properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OnSubmit(e){ | |
var NewSubmission = {}; | |
var Properties = ["Timestamp","Favourite Colour","Explanation"]; | |
var i = 0; | |
for(i = 0; i < Properties.length; i++){ | |
NewSubmission[Properties[i]] = e.values[i]; | |
} | |
MailApp.sendEmail("[email protected]", "Your form was submitted!", | |
"Hey you!" + | |
"\n\n Someone submitted your form. Here's what they had to say:" + | |
"\n\n Favourite Colour: " + NewSubmission["Favourite Colour"] + | |
"\n Explanation: " + NewSubmission["Explanation"]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment