# How to set a stored variable from a text input?

**URL:** https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954
**Category:** Questions about Thunkable X
**Created:** [January 30, 2020, 3:12am UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954 "2020-01-30T03:12:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![chris.bailey230698t](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@chris.bailey230698t](https://community.thunkable.com/u/chris.bailey230698t)
#### Post date: [January 30, 2020, 3:12am UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954/1 "2020-01-30T03:12:29Z")

</div>

I’m not really sure how to explain this one with my lack of lingo, but on the post below, I can only see a stored variable being set when an event occurs that has a designated result (such as ‘value’, ‘result’ etc):

 ![Annotation 2020-01-30 030230](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/0/40ebffcb77b9cf9f12d08487875071100c547235.png)

[https://docs.thunkable.com/variables#app-stored-and-cloud-variables](https://docs.thunkable.com/variables#app-stored-and-cloud-variables)

I’m hoping to be able to store a number that is typed into a box and display it permanently within the app until another number is put in. But this doesn’t come with a ‘result’ or ‘value’ to use and I’m not sure how to translate that into my need.

![EXPLANATION](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/c/7c46ccef806534fcc28c3aa661a72b732e3aad6e.png)

The image above is an attempt at explaining the process, but here’s a video which may shed more light on what I mean. Basically, when you see the ‘33’ pop up - essentially that’s what I need to stick around until it’s changed again. This doesn’t need to be stored in a database - I just need it to be there when the app is closed and reopened.

 ![ezgif.com-video-to-gif (2)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/9/c9abc52682b9a2a3455830d5bd742251408e2633.gif)

 ![Annotation 2020-01-30 030353](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/9/79075e7eddf57d49fafc15674b8fdf4157673736.png)

I think I understand the differences between the different variables now as some users explained them really well in one of my previous posts, but using them is a different story!

Thank you! 🙂

---

<div class="post-metadata">

### Author: ![KaneoheKid](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@KaneoheKid](https://community.thunkable.com/u/KaneoheKid)
#### Post date: [January 30, 2020, 6:49am UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954/2 "2020-01-30T06:49:45Z")

</div>

You are storing the CARB\_INPUT text for later use, correct? If so, I don’t see where the value is stored, it looks like the “updateRecentRatio” function is never called. Are there more blocks?

---

<div class="post-metadata">

### Author: ![chris.bailey230698t](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@chris.bailey230698t](https://community.thunkable.com/u/chris.bailey230698t)
#### Post date: [January 30, 2020, 6:45pm UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954/3 "2020-01-30T18:45:52Z")

</div>

Hi @KaneoheKid, sorry about that - those are just remnants from things I had tried before!

---

<div class="post-metadata">

### Author: ![KaneoheKid](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@KaneoheKid](https://community.thunkable.com/u/KaneoheKid)
#### Post date: [January 31, 2020, 6:50am UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954/4 "2020-01-31T06:50:43Z")

</div>

OK, try looking at this project:

[https://x.thunkable.com/copy/d7486fcab6e8a449834b8d91de9f9ad7](https://x.thunkable.com/copy/d7486fcab6e8a449834b8d91de9f9ad7)

It stores your last saved variable and keeps it, then displays it when you start the app the next time (“Screen1 Opens” block). Is this what you are trying to do? I did the same thing with a map, just to show a slightly different use. Hope this helps.

---

<div class="post-metadata">

### Author: ![chris.bailey230698t](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@chris.bailey230698t](https://community.thunkable.com/u/chris.bailey230698t)
#### Post date: [January 31, 2020, 2:36pm UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954/5 "2020-01-31T14:36:11Z")

</div>

Hi @KaneoheKid, thank you for this! It’s populating the label field but it is resetting to the original number after the app is relogged into - how can I avoid this? I assumed the stored field would be constant until changed?

 ![Annotation 2020-01-31 142445](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/0/702dacb06c6d5f07a8e49f4a69c2a1654b117aa7.png)

---

<div class="post-metadata">

### Author: ![KaneoheKid](https://avatars.discourse-cdn.com/v4/letter/k/d07c76/32.png) [@KaneoheKid](https://community.thunkable.com/u/KaneoheKid)
#### Post date: [February 1, 2020, 8:16pm UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954/6 "2020-02-01T20:16:20Z")

</div>

The problem is that you have two similarly named variables. When the submit\_IC\_button is clicked, you save the “CARB\_INPUT Text” into the temporary variable named appCarbRecent. Therefore, each time you quit the app, that value evaporates. You need to change that block to “stored CarbRecent” which is a variable that persists.

You will still need to load the stored variable result when the screen starts, use the “When Home\_Screen Opens” block as i demonstrated in the example.

---

<div class="post-metadata">

### Author: ![chris.bailey230698t](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@chris.bailey230698t](https://community.thunkable.com/u/chris.bailey230698t)
#### Post date: [February 1, 2020, 9:04pm UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954/7 "2020-02-01T21:04:13Z")

</div>

Hi @KaneoheKid, thank you for this - I apologise this is taking me so long to grasp. I have now amended these elements but it still will not work - I feel as though the ‘when home screen opens’ bit may need to be done differently, can you let me know?

 ![Annotation 2020-02-01 205151](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/d/1d0056ce1122563becbc3efa456519852b0ec600.png)

---

<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:41am UTC](https://community.thunkable.com/t/how-to-set-a-stored-variable-from-a-text-input/434954/8 "2024-11-08T11:41:19Z")

</div>


