Options or Best Practices for Multiple Incoming Data to Google Sheets

36 views
Skip to first unread message

MStar

unread,
Apr 6, 2022, 12:00:51 PM4/6/22
to Google Apps Script Community
Hello, everyone,

I need some advice about sending data to Google Sheets via Apps Script. What are the best practices for this? Or is there a better solution? So far, I have a website that sends data to Apps Script, and it is successfully posted row by row in my spreadsheet. However, there are missing data once multiple users send their data simultaneously. I can see the spreadsheet being populated one row at a time, but then it skips a couple ones. Do you have any thoughts on this? 

Thank you, in advance. 

Tanaike

unread,
Apr 7, 2022, 3:27:59 AM4/7/22
to Google Apps Script Community
About "there are missing data once multiple users send their data simultaneously.",

1. How many users are your Web Apps accessed, simultaneously?
2. Is the LockService used in your script?
3. In your situation, is this data useful? https://tanaikech.github.io/2021/09/15/benchmark-concurrent-writing-to-google-spreadsheet-using-form/

J Rosas

unread,
Apr 9, 2022, 1:21:26 PM4/9/22
to Google Apps Script Community
Hi,  Tanaike. 

Sorry I didn't see this before. Thank you for your reply.

1. In my few tests, 14 users sent data within around 10 seconds and only 10 or 12 made it into the spreadsheet.
2. No. I'm not familiar with LockService. I'm actually not a programmer. I just was able to get a couple pieces of scripts here and there, and tweaked them for my website to work. But I just Googled LockService and it looks like this can help. Does LockService need to be in each function block or just one per entire script?
3. The article you sent answers my question about the Apps Script limitations. Looks like 60 is the top number. That's fine with me. I will read more about LockService, it looks like that's what I need right now.


J Rosas

unread,
Apr 10, 2022, 1:40:58 PM4/10/22
to Google Apps Script Community
Once again, thank you for leading me to the right direction. Your article was very useful. I did some more research and also watched this video:

https://www.youtube.com/watch?v=tnPfLBn9BFs

It explains how LockService works. Very useful for anyone who doesn't know what is this for. I was able to use it in a script and it worked great.
Reply all
Reply to author
Forward
0 new messages