Reputation: 1
I have a google sheet to keep stack of live stock prices and portfolio valuations.
Also, I have some script which runs once a day to provide a permanent record of the valuation.
However, sometimes the stock prices do not load immediately, so the permanent record contains errors.
What is the best way of fixing this ? For example, can I set a trigger to repeat after 30 minutes if there are errors in certain cells ?
I did try a loop to repeat the process within the script if there was an error, but as the maximum time google script can run for is about 5 minutes, it is not effective.
Upvotes: 0
Views: 1010
Reputation: 4247
One possible solution is to set up a control sheet with two variables:
Trigger One: trigger a script first thing in the morning to set the "Has the script run today" value to 'False'.
Trigger Two: trigger a second script (say) every hour to check if
You could run Trigger Two more or less frequently depending on how many iterations it takes to get rid of all the errors.
But do remember that there is a quota for the total trigger run time as well: 90 min per day for a consumer account.
Upvotes: 1