# How do you use stored variables across screens in thunkable x?

**URL:** <https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889>\
**Category:** Questions about Thunkable X\
**Created:** [November 16, 2021, 1:15pm UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889 "2021-11-16T13:15:22Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 21, 2021, 3:14pm UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/21 "2021-11-21T15:14:19Z")

</div>

Let me explain to you the logic of your app.

When you start your app it will open **screen 1** , this will run  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/4/6408532b5ba8024b77fd8005ee004e42030e83bf.png)  
but nothing will show in the screen.  
if you move to **screen 2** , this will run  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/9/b9943a1030bfc69b18f75b83077f3ffcf4642a52.png)  
You will see **this is toto** in the label in **screen 2**  
When you move to **screen 3** , this will run  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/7/677f15791f1782b47b2626fe42b75940c4940f55.png)  
so only one label will show **this is tata** and the button will show **false** written on it.

When you type anything in the text field and press one of the buttons the text you typed will show in label3 or label6 depending which button you press  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/c/fc4c6df9c67f64c29df0a42c0439c511ac42bfc2.png)

Now, **watch carefully wat happens**  
if you move to **screen 1** both `stored variables` will reset to the code in **screen 1**.  
if you go back to **screen 3** only one label will show the value because this is the code in the **screen open** block.

`Stored variables` are used to hold values that will not change a lot such as the user name so it is not expected to change with every screen. But your app is treating it as an `app variable` and it acts as it should.

Hope this is clear. Please feel free to ask for any specific detail.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [November 22, 2021, 4:36am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/22 "2021-11-22T04:36:59Z")

</div>

Oh ok. I’ll try experimenting with stored variables more.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 22, 2021, 5:35am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/23 "2021-11-22T05:35:32Z")

</div>

I created a sample app that makes use of `Stored Variables`  
[https://x.thunkable.com/projectPage/619b26462a8c5200388b8f38](https://x.thunkable.com/projectPage/619b26462a8c5200388b8f38)

Check it.  
You will see that what ever you write in the `stored variable` stays even after exiting the app and open it again.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [November 22, 2021, 5:43am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/24 "2021-11-22T05:43:49Z")

</div>

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [November 22, 2021, 5:45am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/25 "2021-11-22T05:45:06Z")

</div>

So are stored variables useful for sign in?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 22, 2021, 5:49am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/26 "2021-11-22T05:49:26Z")

</div>

> [@ant\_1](#):
>
> are stored variables useful for sign in

`Stored variables` are used for anything that you want to keep it even after the user exits the app so that your app remembers it next time the user open the app.

`Stored variables` are stored in the user phone so it makes sense to use it to save user settings for example or user ID.

In my sample app I’m storing a list of notes the user wants to keep it even after closing the app.

In some cases, you can use `stored variables` as local DB to save small size information.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [November 22, 2021, 5:50am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/27 "2021-11-22T05:50:29Z")

</div>

If I want to use it for sign in, how do I exactly use the stored variables for the sign in?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 22, 2021, 5:52am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/28 "2021-11-22T05:52:35Z")

</div>

> [@ant\_1](#):
>
> how do I exactly use the stored variables for the sign in

See this tutorial from Thunkable

[![](https://img.youtube.com/vi/tdgVeck-sOI/maxresdefault.jpg "Sign in Screen with Stored Variables - Thunkable Drag and Drop UI") ](https://www.youtube.com/watch?v=tdgVeck-sOI)

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [November 22, 2021, 5:58am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/29 "2021-11-22T05:58:30Z")

</div>

Thanks.

---

<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:** [November 22, 2021, 6:00am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/30 "2021-11-22T06:00:56Z")

</div>

I’m curious why you want to have users sign in.

1. Are you planning to store data for each user?
2. Do the users need to access their own data on multiple devices?
3. Do you need access to the data stored for all users?
4. Do you need to prevent some people from using the app?

Because it’s possible that you don’t need a sign in feature at all… that you just need to store the user’s data on the device. That doesn’t require a sign in.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [November 22, 2021, 6:01am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/31 "2021-11-22T06:01:44Z")

</div>

I would like users to be able to log in in different apps every time I make them.

---

<div class="post-metadata">

**Author:** ![ant\_1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ant_1/32/183393_2.png) [@ant\_1](https://community.thunkable.com/u/ant_1)\
**Post date:** [November 22, 2021, 6:02am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/32 "2021-11-22T06:02:21Z")

</div>

And store data for each user

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [November 22, 2021, 6:08am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/33 "2021-11-22T06:08:39Z")

</div>

> [@ant\_1](#):
>
> store data for each user

When you use `stored variable` to store the data for **app1** you will not see it when the user uses **app2**. `Stored variable` is saved in the user’s phone but it is private for the app that stores it.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [February 20, 2022, 6:09am UTC](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889/34 "2022-02-20T06:09:20Z")

</div>

Closed on February 20, 2022, 6:09am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.thunkable.com/t/how-do-you-use-stored-variables-across-screens-in-thunkable-x/1618889.md?page=1)
