# \[Solved\] How to save "stored" variables

**URL:** <https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805>\
**Category:** Questions about Thunkable X\
**Tags:** solved, variables\
**Created:** [January 3, 2020, 9:17pm UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805 "2020-01-03T21:17:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 3, 2020, 9:17pm UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/1 "2020-01-03T21:17:10Z")

</div>

Surprisingly, I couldn’t find information about a fairly basic detail: how do you save a “stored” variable? Also, where is the ‘When [variable] initializes or changes’ block shown in the link below – edit: I found it but it only works for cloud variables, not stored variables.

[https://docs.thunkable.com/variables#for-app-and-stored-variables-updating-when-the-variable-initializes-or-changes](https://docs.thunkable.com/variables#for-app-and-stored-variables-updating-when-the-variable-initializes-or-changes)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [January 4, 2020, 1:38am UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/2 "2020-01-04T01:38:55Z")

</div>

Are you trying to _initialise_ a stored variable @tatiang?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 4, 2020, 2:23am UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/3 "2020-01-04T02:23:00Z")

</div>

@domhnallohanlon No, I’m trying to figure out how stored variables get saved to the device. I’d like to save a value that I can retrieve after closing the app and re-opening it. Would I have to use a cloud variable for that? If not, what is the difference between an app variable and a stored variable? Both of those seem to reset when I close and re-open an app.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 4, 2020, 6:53pm UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/4 "2020-01-04T18:53:42Z")

</div>

When I use ‘stored’ variables, these stay constant across app sessions, even after closing the app. The ‘app’ variable is a temporary variable that should reset each time you close the app.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 4, 2020, 7:25pm UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/5 "2020-01-04T19:25:47Z")

</div>

Alright, I think I made a mistake. It’s working now.

I had assumed that stored variables just save and load automatically and persist after an app is closed. That seems to be the case. What I really need is a variable that is saved to the device but can be managed through code. So that I can determine when it gets saved (or not saved).

As an aside, it looks like a Forever block only cycles every 0.1 seconds, which is pretty slow for a loop.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 4, 2020, 7:34pm UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/6 "2020-01-04T19:34:54Z")

</div>

Could you create an entry like this in the local storage when you actually set the variable in the app?

Set stored var-\> ‘yourvariablename’  
Local storage  
\_\_\_\_\_\_key → save date  
\_\_\_\_\_\_value-\> seconds since 1970 or month/day/hour/minute/second

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 4, 2020, 8:19pm UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/7 "2020-01-04T20:19:20Z")

</div>

Yes. I just had read in the documentation that “stored” variables were a replacement for local storage so I was thinking they worked similarly. They don’t.

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![naqadaqe.quik](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@naqadaqe.quik](https://community.thunkable.com/u/naqadaqe.quik)\
**Post date:** [July 3, 2021, 7:50am UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/8 "2021-07-03T07:50:28Z")

</div>

If stored variable can replace the local storage.  
And I read the docs mentioned can be saved in any data type.

How do I save a todo-list under a stored variable? I mean in the initialise part.  
Thank you.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [July 4, 2021, 3:12am UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/9 "2021-07-04T03:12:17Z")

</div>

If you want to save a bunch of text strings, you can insert the text strings in a list variable and then set the stored variable to that list variable.

---

<div class="post-metadata">

**Author:** ![naqadaqe.quik](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@naqadaqe.quik](https://community.thunkable.com/u/naqadaqe.quik)\
**Post date:** [July 6, 2021, 7:15am UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/10 "2021-07-06T07:15:38Z")

</div>

Thanks ! It works 😁

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:46am UTC](https://community.thunkable.com/t/solved-how-to-save-stored-variables/390805/11 "2024-11-08T11:46:08Z")

</div>


