# Reset value off app variable

**URL:** <https://community.thunkable.com/t/reset-value-off-app-variable/917646>\
**Category:** Questions about Thunkable X\
**Created:** [October 20, 2020, 5:15pm UTC](https://community.thunkable.com/t/reset-value-off-app-variable/917646 "2020-10-20T17:15:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_Sigge](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/christian_sigge/32/27756_2.png) [@Christian\_Sigge](https://community.thunkable.com/u/Christian_Sigge)\
**Post date:** [October 20, 2020, 5:15pm UTC](https://community.thunkable.com/t/reset-value-off-app-variable/917646/1 "2020-10-20T17:15:55Z")

</div>

Hello,  
I have Screens with alot of variables,  
is there an easy way to reset the value of all of the variables used in one screen if screen opens?

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [October 20, 2020, 11:09pm UTC](https://community.thunkable.com/t/reset-value-off-app-variable/917646/2 "2020-10-20T23:09:29Z")

</div>

I have found anything I would can easy when trying to manage (hundreds of) global variables. Here are a few strategies I have used:

1. Build a reset function that resets everything. Not great, but a least it is all in one place.
2. ALWAYS initialize variables at the start of an event or function. The only thing you know about thunkable variables is that they are dirty.
3. Use invisible labels as variables. Rather than use actual variables, use screen components stored in a non-visible column. You can then set up a for each loop within the column and reset them. It also has the advantage as working like a watch window so you can see the state of the system at any given point.

Again, none of these are easy or good, but I’ve tried them…

---

<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:** [October 20, 2020, 11:37pm UTC](https://community.thunkable.com/t/reset-value-off-app-variable/917646/3 "2020-10-20T23:37:55Z")

</div>

Hmm… that invisible label trick is an interesting one. That allows you to use Any Component blocks, I presume?

Any time you find yourself using large numbers of variables, that usually is a red flag that you should be using a spreadsheet so that you can loop through the cells quickly and efficiently. But looping through spreadsheets in Thunkable seems to have its own challenges.

Queue @drted saying “You could loop through JSON…” 😉

---

<div class="post-metadata">

**Author:** ![Christian\_Sigge](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/christian_sigge/32/27756_2.png) [@Christian\_Sigge](https://community.thunkable.com/u/Christian_Sigge)\
**Post date:** [October 21, 2020, 6:16pm UTC](https://community.thunkable.com/t/reset-value-off-app-variable/917646/4 "2020-10-21T18:16:29Z")

</div>

Hello, thak you for your sugestions, but since I allready have these millions of variables I would like to keep them if possible and not try a different solution to store the values temporary.

Now I thought about making a pre screen to just reset all the values inside the app variables,  
but somehow it is not working.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/a/6aa0835d301e72388800b463833e87a18c45db91.png)

---

<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:** [October 21, 2020, 6:57pm UTC](https://community.thunkable.com/t/reset-value-off-app-variable/917646/5 "2020-10-21T18:57:04Z")

</div>

When you say it’s not working… what does that mean? Are none of those values resetting?

What proof do you have that the “pre screen” ran its blocks? For example, did you change the value of a label so you can visually see the change? Is the pre screen first in the list of screens and if not, how are you navigating to it?

While having duplicate value blocks for each variable might not cause problems, it’s inefficient. You only need the When Screen Opens block and I would disable the When Screen Starts block for now.

---

<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, 12:22pm UTC](https://community.thunkable.com/t/reset-value-off-app-variable/917646/6 "2024-11-08T12:22:01Z")

</div>


