Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psychemedia/430753 to your computer and use it in GitHub Desktop.
Save psychemedia/430753 to your computer and use it in GitHub Desktop.
//Test function for Google Apps Script onFormSubmit
//Two sheets in a single spreadsheet doc
//First sheet corresponds to form
//Second sheet just displays one of the elements from the most recent form submission
// the function testOnSub() has a trigger associated with it: 'From spreadsheet' 'On form submit'
function testOnSub() {
var ss = SpreadsheetApp.openById(SPREADSHEET_KEY);
var sheet=ss.getSheets()[1];
var form=ss.getSheets()[0];
var lr=form.getLastRow();
var el=form.getRange(lr,2,1,1).getValue();
var t=el;//"done";
sheet.getRange(1,1,1,1).setValue(t);
}​
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment