Submits data from the same user twice google form

538 views
Skip to first unread message

Jackie Long

unread,
Aug 1, 2022, 2:33:43 AM8/1/22
to Google Apps Script Community
Hi
I've been having a problem with concurrent users submitting forms at the same time where I have tried to take data from an automated form response sheet generated by google forms and populate another form.

The problem is I have a trigger when the form submits, it takes the data from the automated form and places it in another form, where on concurrent users submitting at the same time, the trigger script is only able to get the latest value and therefore grabs the latest value twice since the 2 users submitted at the same time.

I have looked into coding the data grabbing processes in the google form app script rather than the google sheets app script and applying a LockService, however, I had trouble combining these scripts.

So I was wondering if anyone had ideas on how I could make this script work.


Laurie J. Nason

unread,
Aug 1, 2022, 4:58:18 AM8/1/22
to google-apps-sc...@googlegroups.com
Hi Jackie,
If you absolutely have to have the information moved over to your second form as soon as someone submits, then I am afraid I don’t know how you can do this other than moving away from the google form to a web form solution. 
If, on the other hand, you are Ok with the information being populated on a schedule then I would suggest looking at having a timed trigger rather than an on submit that runs at a frequency that will work for you. I would make sure though that you write back to the original sheet with a date stamp to indicate that you have processed the row, so that the next time the script runs, you are not duplicating things. 

Laurie

------ Original Message ------
From "Jackie Long" <gugu...@gmail.com>
To "Google Apps Script Community" <google-apps-sc...@googlegroups.com>
Date 01/08/2022 07:33:42
Subject [Apps-Script] Submits data from the same user twice google form

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/ba8d119e-d57a-48df-a733-a5be51006ad4n%40googlegroups.com.

Goran Kukurin

unread,
Aug 1, 2022, 9:40:35 AM8/1/22
to Google Apps Script Community
use LockService in the form submission handler
Reply all
Reply to author
Forward
0 new messages