G
G
Gamlex872020-07-15 11:37:34
Google Apps Script
Gamlex87, 2020-07-15 11:37:34

How to bypass editing trigger at the same time?

Welcome all.
The problem is the following. I have a Google Sheets table. I wrote a script so that changes in this table are logged to another table. To do this, I use my function, tied to the created trigger, which fires when the table changes. A log table is a sequential record of rows (under each other) with information about changes. That is, there is a cell in which the number of the free line is registered. As soon as there are changes, the script looks at this number and writes data to this line, increasing the value of the counter.

The problem is that when changing cells quickly or when users name cells at the same time, the trigger fires almost simultaneously and in the log table one data line (apparently not having time to save) is overwritten by another data line that should be below it.
I tried to use global properties (getScriptProperties), the situation is the same - one operation does not have time to save all the data, and the next operation climbs into the same line. Question - how can I fix this, get around it?

5f0ec0443fbe2446926015.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
robprane, 2020-07-15
@robprane

I came across this, but my solution is a crutch, because in my case there was a unique value that turned out to be tied to a separate line. https://developers.google.com/apps-script/referenc...
can help you , there are more examples there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question