The Create Row block is asynchronous, meaning that it runs its code while Thunkable continues to evaluate code after it. Thunkable does not wait for it to finish unless you put all other code in the “do” section of the block. So a loop that creates rows with a specific variable object (in your case “j”) may create a row with the wrong information or have other unpredictable results.
Why are you creating rows when the screen opens? Sorry if you already mentioned this but what does each row of the database contain? For example is it a user record, a business, a map location?
@tatiang So I have several screens which represent different categories - Each screen contains image click button (as I call them) and when they are chosen the API call is made that relates to that search e.g. looking for X in a radius please list these to the user.
when the list is displayed - this is when it moves to another screen and that is where it builds the data within the data list viewer from the API JSON data variable - I was trying to figure out a better way to do this when that screen opens as I can see the issues it is also causing doing it that way. I could not seen a way in Thunkable to call an object from another screen e.g. screen1 calls screen2 data list viewer prior to opening screen2
Yeah, these kinds of “live” displays of API data can be tricky, especially with Thunkable. You could make the API call on a different screen but the way you’re creating rows is going to take some time no matter where that happens. A faster method is to save the data to Firebase and use cloning blocks to create your own Data Viewer List. It’s quite complicated to do all of that but it would work on screen open.