Stored variables

Thanks, Paul. It did work after closing thunk live and re-opening. Note that the same app with cloud variable doesn’t work (nothing added to list).

Dave

im still having a few problems whit list, if i try to get# whit a stored variable, dont work, but if i put the value manually it works.

Sorry guys, i would like to know what happen to a stored var if the app is removed from the phone (iOS). Does it remain and it can be retrieved when the app is reinstalled? tks !

No, sir! If the app is deleted, so is any app related data stored on the phone

1 Like

thank you @jared

1 Like

In my test App, if I load an Airtable DB (GetAllRows) and query it after using an app variable set as an “empty list”, it returns the value as it should (after a good 25 secs!!!). However, if I try to store the same “GetAllRows value” in a stored app (also set as an empty list) so to be able to use the Airtable DB offline it will not work. When I try to empty the list with a button it still does not work. Am I missing something? Did I make any mistake in the code? This is my test app Thunkable Thanks for any hintScreen Shot 2563-06-04 at 08.26.40 Screen Shot 2563-06-04 at 08.26.57

Try adding the Local Storage component to the app.After that, did your stored variables start working?

Even with local storage it doesn’t seem to work! Even though after inserting the value in the stored value it returns a value for not nil and not empty list. So something has been recorded. Yet, if I click a button that sets the list empty again, it still gives that it is not an empty list :disappointed_relieved:

Everything is clear. You are using the wrong block. To check the list for emptiness, you need to use the “is empty” block, and you use the block to create an empty list!

изображение

I tried to follow your advice. It works for the empty-list check. However, if I try to store the GetAllRows which is in the app variable “List1” to the stored variable “list” (pushing the button “Store Value”), it doesn’t work!. It is as if nothing happens and it does not return any of the checks: stored or empty list. ThunkableScreen Shot 2563-06-04 at 19.52.58

Try using Local Storage instead of stored. If there is a save, then try using the storage variable again. You have the same problem as I had - after the block of the stored variable, the blocks do not work.

I tried but it still doesn’t work! :sob: Maybe the DataBase is to big? When I click on the button to store the value within the app variable nothing happens. It does not return the value “stored”. What am I missing?

Have you updated Live?

First, you use a loop suboptimally when getting all the rows from AirTable. When you find the desired entry, you need to interrupt the loop.

Second, you need to check everything step by step:

  1. does the Data come from AirTable?If not, there is an error with getting data. if Yes, go further

  2. when the button is clicked, data is saved? No - an error or bug when saving data. Yes-go further

  3. can I get the Data after saving? No-there is a problem with getting data. Yes, it’s all right.

How is it with you?

You also need to view the size of the data. I noticed that problems with blocks occur if the amount of data in a text field exceeds 1 megabyte

  1. Yes. My app on mobile is up-to-date. I have cleared cache and data too.
  2. I do not know how to interrupt the loop with Airtable
  3. the data comes with Airtable and the correct field is displayed according to the query
  4. No, I the data is not being saved. I think the size of the GetAllRows coming from Airtable is quite big (when I saved it as a CSV file it was around 9MB!). However it does work well with app variables.
Yes. My app on mobile is up-to-date. I have cleared cache and data too.
I do not know how to interrupt the loop with Airtable
the data comes with Airtable and the correct field is displayed according to the query

Use изображение

No, I the data is not being saved. I think the size of the GetAllRows coming from Airtable is quite big (when I saved it as a CSV file it was around 9MB!). However it does work well with app variables.

Try saving the value 100 and get it. Does it work?

9Mb - that’s a lot! Blocks don’t work correctly with this volume

Unfortunately, I can’t answer the question of how much data blocks can work with. Try displaying the last entry on the screen after the getallrows block. Is it displayed correctly?

I tried using local storage with the “100” value. It is correctly saved and correctly retrieved after starting the app again. Stored variable also works well with a “100” value. Correctly saved and correctly retrieved!
However both stored variable and Local storage seem not to be able to store the “GetAllRows” value coming from Airtable.
However when I store the “GetAllRows” data in an app variable it does work well and fast. It takes time to retrieve data (around 25 secs.). But after the data is stored on the app variable it works very fast and well. In less than a second all queries return correct cell data.
It is strange: if it works so well with an app variable…why it could not be stored locally? Or is it a kind of bug/limitation that Thunkable developers could solve?
That would be very helpful as it would give the possibility to use bigger Databases offline.

I think I can answer your question. The fact is that in a cycle of 1000 iterations, app variables work about 53 times faster than stored blocks. Of course, it is wrong to use a loop test in your case when you are trying to save a large chunk of data, but if your data were going through a loop, then in theory it would take a stored block 1,325 seconds or 22 minutes! to work with data that takes only 25 seconds for the app variable. I think you can see the difference.

Try to get all the rows in the block created from the function parameter instead of the app block for fun. I think it will take much less time than 25 seconds to do this.