Get code from this link Global variables in Google Script (spreadsheet)
I create a custom function and there I declare a variable using PropertiesService
Globals.init('queue', []);
When i try to stretch out my custom function for example on 10 rows
function pstatTest(url){
Globals.init('queue', []);
counter.push(url);
Globals.flush();
return "Loading...";
}
Not all data is written to a variable declared earlier
As I suppose, this is due to the fact that the writing is asynchronous and the return in the function is called faster than writing.
Please tell me how to fix this code so that when pulling into a global variable, all data from the cells is written