How to use local storage in thunkable drag and drop and even how to create local storage

How to use local storage in thunkable drag and drop and even how to create local storage

1 Like

Use stored variabeles.
There is no Component for local storage in the DnD UI.

Yes but he exit the app and then there will be noting in it

Use the set (variabel name) to block to give IT value

Select the storage icon first
then choose “+” in the Data Sources
See my schrrenshots
image
You will see a dialogue, Choose “Create New”
image
You will see another dialogue box choose “Create your own table”
image

This is the Local Storage in the DnD UI.

1 Like

Hi there,

If you want to save data between app sessions, then Stored Variables are perfect!
They are as easy to work with as any variables, but the data saved to a stored variable will be saved between app sessions.
You can read more about stored variables here.

1 Like

Hello Jane,
If I understood the examples in the variables and login videos, I should be able to use the stored variables to save access tokens for URL links that I use to control IOT devices.
The values will need to be initialized by the user the first time the app runs.
If I share my app, the tokens will not be part of the APK file. Is this correct?

Hello @muneer,
Regarding the local storage example, does that file/table get shared with the app, or does it stay on the device running the app?
Can I create this file, say with a text editor, and install it on several devices?

I am looking for a way to hide these tokens, which can be just one or tens of them. Hence, the stored variable versus local table.
Here is an example from a Classic app that I am porting to X. I need to hide the long string after access_token=…
image

I understand there are better methods for validating a user. I am looking for the simplest implementation
leveraging what I already have, while maintaining some level of security.

Thanks,
Pescatore

1 Like

When you use the local storage (create your own table) then whatever you store in this table will be part of your app whenever any one install it. The data you save in the table is not visible to the user but you can use it in your app the way you like and if you want the user to see it then you should display it in the app.

With stored variables, you need to initialize them in your code to whatever value you want or allow the user to enter a value and you store it in these variables which will be stored in the user device.

1 Like

Thanks for the reply.
Looks like I can wipe out the stored variable/table before sharing the app. Then the user can fill in data, which stays with that device.

1 Like