was955

Google forms 2.0

Jun 8th, 2021
1,002
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function onFormSubmit(e) {
  2.   var payload = {};
  3.   var response = e.response.getItemResponses();
  4.  
  5.   payload["Email"] = e.response.getRespondentEmail();
  6.   payload["Form_Title"] = FormApp.getActiveForm().getTitle();
  7.   payload["Form_Id"] = FormApp.getActiveForm().getId();
  8.  
  9.   for (var i = 0; i < response.length; i++) {
  10.       var question = response[i].getItem().getTitle();
  11.       var answer = response[i].getResponse();
  12.       payload[question] = answer;
  13.   }
  14.  
  15.  
RAW Paste Data