My Google Sheet doesn't Update the data from Google Form

100 views Asked by At

So I'm currently doing a security system where it will report based on the reporting category and submit the form. For my system, there are 7 types of reporting. 6 of them are working fine, but 1 of the reporting doesn't save the data into the Google Sheet, which also caused it cannot send Message to WhatsApp (the group id is already declared in Apps Script). For the whole process, its start with fill in the form, then the data will send to Zapier automation, then Zapier will send the data to Google Sheet, and then trigger the code to send WhatsApp. But now my biggest issue is, there is one reporting doesn't save the data into sheet, while others works completely fine. What should I do? I need your guys help!

I've checked the variable and the link id carefully to make sure there is no error, but still the one type of reporting is not working what I want.

1

There are 1 answers

0
Cooper On

Try setting up an onFormSubmit trigger to see if you are getting a trigger for all of your types.

I might try a script something like this:

Save both functions in the linked spreadsheet.

function onFormSubmit(e) {
  console.log(JSON.stringify(e));
}

Run this function to create an onFormSubmit trigger and check your executions log for executions of function onFormSubmit() the console.log() will display the event object which will display the answers to the question that were submitted on the form.

function setupOnFormSubmitTrigger() {
  if(ScriptApp.getProjectTriggers().filter(t => t.getHandlerFunction() == "onFormSubmit").length == 0) {
    ScriptApp.newTrigger().forSpreadsheet("onFormSubmit").onFormSubmit().create();
  }
}

I am assuming that you don't have a form submit trigger setup if you do the please post the code in the question. You probably will not want to create another trigger. Instead you can use the one that you already have.