How can I be getting multiple unwanted event blocks from the same onFormSubmit Trigger?

ぃ、小莉子 提交于 2019-11-26 10:57:07

Getting spurious onFormSubmit Triggers

As @J.G. pointed out I was getting more that one trigger from each submission of the form.

I noticed by logging the e.values into a spreadsheet that I was not getting any of the answers. So to eliminate these unwanted triggers I just used the following logic.

if(e.values && !e.values[1]){return;} where e.values[1] was a required question.

My log:

The lines with no value in column C are unwanted triggers.

I think your code proved that some triggers are spurious and unwanted and as such Google should not be generating them. I submitted a feedback item to Google on a similar issue.

In my unwanted triggers, I was only getting the e.range.getRow() to determine which row changed, then going to the row to do the required computation. In my case the row contained correct info for all spurious triggers (probably because the first one correctly recorded the data in the spreadsheet).

Your code is a great backstop to prevent it, but I have way too many forms and triggers to cover. Putting this code in all those places would be a pain. Let's hope google solves this issue soon and we don't see any more spurious triggers occurring.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!