Skip to content

Instantly share code, notes, and snippets.

@wchiquito
Last active December 19, 2015 13:58
Show Gist options
  • Select an option

  • Save wchiquito/5965451 to your computer and use it in GitHub Desktop.

Select an option

Save wchiquito/5965451 to your computer and use it in GitHub Desktop.
[Google Apps Script] Issue 2969: On Submit trigger is not working when form response is edited - https://code.google.com/p/google-apps-script-issues/issues/detail?id=2969
/*
In the Form, create new trigger:
Run: onFormSubmit
Events: From form
On form submit
Runs for new / edit responses
*/
/* CODE FOR DEMONSTRATION PURPOSES */
function onFormSubmit(r) {
var itemResponse, formResponse = r.response, itemResponses = formResponse.getItemResponses();
for (var item = 0, len = itemResponses.length; item < len; ++item) {
itemResponse = itemResponses[item];
Logger.log('Response #%s to the question "%s" was "%s"',
(item + 1).toString(),
itemResponse.getItem().getTitle(),
itemResponse.getResponse());
}
}
/* CODE FOR DEMONSTRATION PURPOSES */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment