Slow app execution to allow Google sheet time to recalculate


In my app based on Metric Rat's CRUDQ 11 guide I am having a problem with the data in ListWiew renewing before the spreadsheet has recalculated formulas after the App updates data in some fields. The first photo is the code I am using and the second is the continuation of photo 1.

Basically what I want to do is to update the data in Columns C & D and with that update Column F gets recalculated to the number of people shown as "In" in Column C.

  1. The updated sheet is called into ListView and occasionally the data in Column F has not had time to recalculate so is old and wrong.

  2. Also - I want to notify the user that when value of the Users Field in Column F is zero and Column C is "Out" that they are the last to leave the building and must set the burglar alarm. this is done by reading the updated data from the spreadsheet and placing it in two textboxes as shown in Photo 2. Unfortunately the text boxes don't update in time.

Is there any way to delay the execution of the steps in the program for say 2 seconds at the point between updating the spreadsheet (say at the end of execution of CRUDllAction and calling it back to listview?

Do not update items in the app until the new data returns from the spreadsheet.

Yes - the problem is that the new data sometimes returns to the app before the spreadsheet has completed its recalculation so the new data in the app is wrong.

Make the first call to your spreadsheet, when that data returns make the second call, then load all the data together.

I didn't quiet understand your answer but tried several versions of what I thought you meant and when that failed I dropped the feature I was planning to use. I also found your post at How do you display current time through a label? which solved other problems I was having in refreshing the time using Timepick by using part of the script so thanks greatly for that.

Does this clarify ?

Thanks so much for that.clarification.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.