# Variable scope definition in X platform

**URL:** https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242
**Category:** Questions about Thunkable X
**Created:** [October 10, 2018, 12:22pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242 "2018-10-10T12:22:34Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![LGreen](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@LGreen](https://community.thunkable.com/u/LGreen)
#### Post date: [October 10, 2018, 12:22pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/1 "2018-10-10T12:22:34Z")

</div>

quick question:  
does variable in Thunkable X global?  
will it keep its value when moving from screen A to screen B?  
I remember in the classic version we could define the scope to global however I’m not sure in X version.

Thanks in advance. 🙂

---

<div class="post-metadata">

### Author: ![AcrobatEpee](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/acrobatepee/32/26336_2.png) [@AcrobatEpee](https://community.thunkable.com/u/AcrobatEpee)
#### Post date: [October 10, 2018, 1:12pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/2 "2018-10-10T13:12:20Z")

</div>

No, you need to store it in a localstorage

---

<div class="post-metadata">

### Author: ![LGreen](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@LGreen](https://community.thunkable.com/u/LGreen)
#### Post date: [October 10, 2018, 1:21pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/3 "2018-10-10T13:21:32Z")

</div>

Thanks, this is what I thought.

---

<div class="post-metadata">

### Author: ![AcrobatEpee](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/acrobatepee/32/26336_2.png) [@AcrobatEpee](https://community.thunkable.com/u/AcrobatEpee)
#### Post date: [October 10, 2018, 1:50pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/4 "2018-10-10T13:50:35Z")

</div>

Tell me if you need any help 🙂

Good day 🙂

---

<div class="post-metadata">

### Author: ![Kyle\_Williams](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@Kyle\_Williams](https://community.thunkable.com/u/Kyle_Williams)
#### Post date: [October 11, 2018, 5:25am UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/5 "2018-10-11T05:25:55Z")

</div>

It actually looks like the variable blocks have been updated—but still waiting documentation from Thunkable on these changes.

---

<div class="post-metadata">

### Author: ![paulmw](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@paulmw](https://community.thunkable.com/u/paulmw)
#### Post date: [October 11, 2018, 9:27am UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/6 "2018-10-11T09:27:15Z")

</div>

Yes, we just changed how variables work. When you make an “app variable” it will work throughout your app, on all screens! The documentation will catch up soon.

Example project:  
[https://x.thunkable.com/copy/ead3b7a96c728c7a75403d8d5e886dd7](https://x.thunkable.com/copy/ead3b7a96c728c7a75403d8d5e886dd7)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/2/e26bb65aa51936339ddee64c38d347532d0f566a.png)

---

<div class="post-metadata">

### Author: ![LGreen](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@LGreen](https://community.thunkable.com/u/LGreen)
#### Post date: [October 11, 2018, 9:33am UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/7 "2018-10-11T09:33:12Z")

</div>

yes I can see now. nice addition.  
we have: App, Stored and cloud. waiting for documentation.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/c/1c7c278edeac6be145f578384c8909e2450a2148.png)

---

<div class="post-metadata">

### Author: ![paulmw](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@paulmw](https://community.thunkable.com/u/paulmw)
#### Post date: [October 11, 2018, 9:40am UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/8 "2018-10-11T09:40:32Z")

</div>

App variables work across screens, and are re-initialized when the app starts (make sure you have the latest companion app for this to work). Stored variables get saved on the device (same thing as local storage), and cloud variables are stored in firebase (same as realtime db).

---

<div class="post-metadata">

### Author: ![LGreen](https://avatars.discourse-cdn.com/v4/letter/l/ed655f/32.png) [@LGreen](https://community.thunkable.com/u/LGreen)
#### Post date: [October 11, 2018, 10:50am UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/9 "2018-10-11T10:50:37Z")

</div>

Thanks, do you know what will become with variables that was set prior to this change ?

---

<div class="post-metadata">

### Author: ![paulmw](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@paulmw](https://community.thunkable.com/u/paulmw)
#### Post date: [October 11, 2018, 11:27am UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/10 "2018-10-11T11:27:26Z")

</div>

Previous variables work exactly the same way as they always have - the only exception is that we’ve removed the create variable button (since it’s better to create app variables).

---

<div class="post-metadata">

### Author: ![Rob\_Schoemaker](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rob_schoemaker/32/21023_2.png) [@Rob\_Schoemaker](https://community.thunkable.com/u/Rob_Schoemaker)
#### Post date: [October 11, 2018, 1:51pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/11 "2018-10-11T13:51:09Z")

</div>

Nice, too bad there was no documentation/announcement of this change. Now I stumbled on this thread by accident…  
Would be nice if this type of changes would be announced somewhere 😉

---

<div class="post-metadata">

### Author: ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)
#### Post date: [October 11, 2018, 6:25pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/12 "2018-10-11T18:25:53Z")

</div>

> [@Rob\_Schoemaker](#):
>
> Nice, too bad there was no documentation/announcement of this change. Now I stumbled on this thread by accident…  
> Would be nice if this type of changes would be announced somewhere 😉

That’s our bad. Normally something like this would have at least been mentioned in [our release notes](https://docs.thunkable.com/thunkable-cross-platform/release-notes). Sorry about that.

-Mark

---

<div class="post-metadata">

### Author: ![Michael\_Mckenna](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@Michael\_Mckenna](https://community.thunkable.com/u/Michael_Mckenna)
#### Post date: [October 11, 2018, 6:32pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/13 "2018-10-11T18:32:52Z")

</div>

Is there documentation coming for the new variable infrastructure? I have functions that worked fine before the update and now don’t work.

For example I set variable to an empty object, then set a property int hat object to an input, convert to a json, then send as an API POST body. It worked fine before, but now doesn’t set the property and ends up sending an empty json. Any ideas?

---

<div class="post-metadata">

### Author: ![Rob\_Schoemaker](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rob_schoemaker/32/21023_2.png) [@Rob\_Schoemaker](https://community.thunkable.com/u/Rob_Schoemaker)
#### Post date: [October 11, 2018, 6:44pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/14 "2018-10-11T18:44:48Z")

</div>

That’s why I check the release notes a couple of times each week. Especially on Wednesdays since it looks like your sprints normally end around that day 😜  
Anyway, nice improvement. Good that it’s in the release notes now.

---

<div class="post-metadata">

### Author: ![paulmw](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@paulmw](https://community.thunkable.com/u/paulmw)
#### Post date: [October 11, 2018, 6:48pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/15 "2018-10-11T18:48:46Z")

</div>

You should update to the latest version of Thunkable Live.

---

<div class="post-metadata">

### Author: ![Michael\_Mckenna](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@Michael\_Mckenna](https://community.thunkable.com/u/Michael_Mckenna)
#### Post date: [October 11, 2018, 6:51pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/16 "2018-10-11T18:51:28Z")

</div>

Thanks for the info, I checked that earlier and am up to date

---

<div class="post-metadata">

### Author: ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)
#### Post date: [October 11, 2018, 6:55pm UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/17 "2018-10-11T18:55:33Z")

</div>

> [@Michael\_Mckenna](#):
>
> Thanks for the info, I checked that earlier and am up to date

@Michael_Mckenna, Can you send us a share link to a simple example of the behavior that your seeing?

Thanks in advance.

-Mark

---

<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:55am UTC](https://community.thunkable.com/t/variable-scope-definition-in-x-platform/51242/18 "2024-11-08T11:55:12Z")

</div>


