Skip to content

Instantly share code, notes, and snippets.

@sauntimo
Created November 10, 2012 23:52
Show Gist options
  • Save sauntimo/4053026 to your computer and use it in GitHub Desktop.
Save sauntimo/4053026 to your computer and use it in GitHub Desktop.
Create NewSubmission Object
/* ----- CREATE NEWSUBMISSION OBJECT ----- */
var NewSubmission = {};
var Properties = ["Section One: Product Details","Size","Style","Filling","Topping","Decoration",
"Section Two: Delivery Details","First name","Family name","Email Address","Address","Delivery","Day","Month","Year"];
var i = 0;
var iSkip = 0;
for(i = 0; i < Properties.length; i++){
if(Properties[i].slice(0,7) == "Section"){
NewSubmission[Properties[i]] = " ";
iSkip++;
} else {
//add 1 because Timestamp is e.values[0] and we don't need this
NewSubmission[Properties[i]] = e.values[(i+1)-iSkip];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment