Event Loop with onForm Submit and On Edit

6 views
Skip to first unread message

Zukisa Dyibana

unread,
Jul 21, 2021, 7:25:36 AM7/21/21
to Google Apps Script Community
Good Day,

I have a form that users use to submit order requests. The form is linked to a Spreadsheet and the Spreadsheet is bound to a script. The script has a function named "GetFormResponses(e)" and this function is linked to an onForm Submit trigger that I created manually. 

The process works as intended however I have noticed that the same event(e) triggers the script multiple times. I have a separate sheet(control sheet) where I restructure the data that I get from e.values to kind of consolidate the data. With the event loop my control sheet gets duplicated with the same data set from the event(e). When I look at the form responses sheet there is only one entry per request.

Is there a way to dedupe avoiding to process the code if the object was already process?

Thanks in Advance


Alan Wells

unread,
Jul 21, 2021, 8:19:44 AM7/21/21
to Google Apps Script Community
If there is an editor/collaborator to the Google Form then the submit function can get triggered twice.
So if you've added an editor/collaborator to the Google Form, remove all of them and hopefully it won't trigger twice.
Reply all
Reply to author
Forward
0 new messages