API2 is uploading some files from Google Sheets but not others--happens for different files on different startups

Uh Oh. In my opinion there is no reason to load ALL the questions in one event handler. The issue may be loading all at once. The files do not appear to being fully loaded when the next set is installed.

1 Like

Your code lacks patience and focus.

It uses timers where it should instead to strive to do only one thing at a time, after the preceding thing finished.

In this case, it is your fetching of questions and answers from the wenb.


I see you have separate Web components and .GotText events for the questions and answers in each category, but you made the risky choice of shooting out requests for both without regard for completion of each request.

The safe way is:

Request questions in current category from web.

In current .GotText event for questions in that category, save the questions and display them, then
request the answers for that category.
In the .GotText for the category's answers web component, save the answers and post the questions for the user.

Notice that by daisy chaining the multiple web requests this way you will not need any timers. Your timing will always be rock solid.

P.S. Learn to use tables and procedure parameters, to avoid rubber stamping out code like that. A common procedure reduces the number of places to fix when you make a mistake.

I have looked for a place to only pull the Q&As in when the category is first picked. However, I couldn't find a good place.

That said, I'm attaching the aia file to the program that worked just before this one. Thank goodness I saved it. All the files upload correctly and ironically I have all those MANY characters that I will need to go back and delete (37 vice my updated 16!) and yet it all works.

I will heed your advice and see if I can understand. I need to go back and correct those always enabled timers on this file.

Just so you know, those two blocks you pulled up, they were only added after the program started crashing and no pulling in all the answers--that was my attempt to slow it down. You won't see those blocks in this program. :slight_smile:

Here's a working copy of my program:

RestartTest.aia (3.5 MB)

If it works, I advise you to quit while you're ahead.

Life's too short to go cleaning up rubber stamped programs.

Here is a sample of sequential table loading, for your next project:

2 Likes