Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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
You can’t perform that action at this time.