# How to Store Data Inside the Internal Storage

**URL:** <https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964>\
**Category:** Questions about Thunkable X\
**Created:** [April 23, 2020, 5:45pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964 "2020-04-23T17:45:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![iqbandara11xvit](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iqbandara11xvit](https://community.thunkable.com/u/iqbandara11xvit)\
**Post date:** [April 23, 2020, 5:45pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/1 "2020-04-23T17:45:35Z")

</div>

**I am Developing a offline Game.**  
I want to _store data, create by the user, inside the internal storage_ of there phone.  
Anyone can help me for how to do this please.  
🙂

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 23, 2020, 5:52pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/2 "2020-04-23T17:52:19Z")

</div>

Hi. You can make use of ‘stored’ variables. This saves whatever value you assign to it on the device. A stored variable retains the data on the device for as long as the app is installed on the Phone. Have a look at the documentation as well: [https://docs.thunkable.com/variables](https://docs.thunkable.com/variables)

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [April 23, 2020, 6:32pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/3 "2020-04-23T18:32:05Z")

</div>

If you’re only storing a few pieces of information then @dmndeklerkeb’s answer is perfect.

If you are looking to store a lot of data that has similar layouts you could look at [Local DB](https://docs.thunkable.com/local-db). It’s just a spreadsheet but it’s stored locally.

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 23, 2020, 6:33pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/4 "2020-04-23T18:33:58Z")

</div>

You are definitely correct @eoinparkinson !

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [April 24, 2020, 2:53am UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/5 "2020-04-24T02:53:39Z")

</div>

@eoinparkinson I had a doubt with LocalDB - would you mind clearing it?

Does localDB refresh itself every session?

Thanks!

---

<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:** [April 24, 2020, 8:47am UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/6 "2020-04-24T08:47:05Z")

</div>

No, LocalDB should be persistent if the app is installed on your phone.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![iqbandara11xvit](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iqbandara11xvit](https://community.thunkable.com/u/iqbandara11xvit)\
**Post date:** [April 24, 2020, 6:48pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/7 "2020-04-24T18:48:48Z")

</div>

Thank you **dmndeklerkeb** and **eoinparkinson** for helping me to solve this problem.

dmndeklerkeb, I used “app” method in variables instead of “stored” method. i will try your solution. 🙂

But I used Local DB method. But it’s not worked. only show the data that i entered in the app. user’s modifications not stored. when i close and reopen the app. the user’s data are disappeared.

may be it would happened due to not define variables as ‘stored’.

---

<div class="post-metadata">

**Author:** ![iqbandara11xvit](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iqbandara11xvit](https://community.thunkable.com/u/iqbandara11xvit)\
**Post date:** [April 24, 2020, 7:19pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/8 "2020-04-24T19:19:37Z")

</div>

I tried.  
But i cannot assign a value for variables at the beginning when i set the variable type as “stored”. What should i do now? 🤔

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 25, 2020, 9:34am UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/9 "2020-04-25T09:34:21Z")

</div>

You can assign values to a ‘stored’ variable. What I did was to store the user ID on sign in to a stored variable and then to use the values in the stored variable to populate the sign in email address and password input fields. I did this so the user does not have to enter his/her email and password each time when logging in to the app. What I did with sign up was, to clear the stored values in the stored variable to save the new successful sign up values so that the signed up user don’t have to enter his/her details when signing in.

You can therefore assign a value to a stored variable for instance when a screen starts. This will ensure the initial value is stored on the device. The stored value (Global value) is then available for use in all screens’ blocks of the app if required.

---

<div class="post-metadata">

**Author:** ![iqbandara11xvit](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iqbandara11xvit](https://community.thunkable.com/u/iqbandara11xvit)\
**Post date:** [April 25, 2020, 1:53pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/10 "2020-04-25T13:53:08Z")

</div>

Ok.  
I am working it on right now.  
thanks for the explanation. 😀

---

<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:** [April 25, 2020, 5:28pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/11 "2020-04-25T17:28:47Z")

</div>

So, if we want settings/data to stick around post updates, use localDB. If it’s not vital between versions, using the stored variable is the easier item to use?

I think this answers my question of how to retain settings between updates. I currently store settings in stored variables. I’ll be updating now!

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [April 25, 2020, 9:21pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/12 "2020-04-25T21:21:37Z")

</div>

@jared stored variables stay stored even through new releases. I can confirm this on Android and iOS!

---

<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:** [April 25, 2020, 9:21pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/13 "2020-04-25T21:21:54Z")

</div>

perhaps this is a bug that Only i am experiencing

---

<div class="post-metadata">

**Author:** ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)\
**Post date:** [April 25, 2020, 10:31pm UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/14 "2020-04-25T22:31:01Z")

</div>

Maybe try replace the blocks? If that doesn’t work maybe make a post about it.

---

<div class="post-metadata">

**Author:** ![iqbandara11xvit](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iqbandara11xvit](https://community.thunkable.com/u/iqbandara11xvit)\
**Post date:** [April 27, 2020, 11:07am UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/15 "2020-04-27T11:07:47Z")

</div>

Because of i defined variables as “stored”, do i need to connect those variables with a local DB for initialize some values when the app starts.

Thus if some variable have zero values at the beginning, is that necessary to connect those variables with a local DB.

---

<div class="post-metadata">

**Author:** ![dmndeklerkeb](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dmndeklerkeb/32/67152_2.png) [@dmndeklerkeb](https://community.thunkable.com/u/dmndeklerkeb)\
**Post date:** [April 27, 2020, 11:36am UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/16 "2020-04-27T11:36:17Z")

</div>

No,it is not necessary. It all depends on what you want to do. You can use the Control block When Screen Starts to initialize the value when the screen starts and a button for instance to set a new stored value, or you can set the value in the app to keep score or track of a value.

Screen starts: Stored value = 0  
Button (+5) clicked: Stored value = 5  
Button (+5) clicked again: Stored value = 10  
Exit app: Stored value = 10

If you have used the control block when Screen Starts and the app starts again, then it will set it back to 0 again. You can override this with an if statement. If the Stored value is not empty or 0, then keep it to the latest stored value, else set it back to 0. Again, it depends on what you want to do.

A stored variable value saves that value to the device without saving it in a local DB.

---

<div class="post-metadata">

**Author:** ![iqbandara11xvit](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@iqbandara11xvit](https://community.thunkable.com/u/iqbandara11xvit)\
**Post date:** [April 30, 2020, 7:51am UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/17 "2020-04-30T07:51:28Z")

</div>

Thanks dmndeklerkeb.  
It’s a nice explanation.  
currently I am re-correcting my previous blocks as you explained.

---

<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:29am UTC](https://community.thunkable.com/t/how-to-store-data-inside-the-internal-storage/563964/18 "2024-11-08T11:29:34Z")

</div>


