# How to set a value to a variable only once?

**URL:** <https://community.thunkable.com/t/how-to-set-a-value-to-a-variable-only-once/2634527>\
**Category:** Questions about Thunkable X\
**Created:** [October 9, 2023, 5:25am UTC](https://community.thunkable.com/t/how-to-set-a-value-to-a-variable-only-once/2634527 "2023-10-09T05:25:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cseducator\_mindchamp](https://avatars.discourse-cdn.com/v4/letter/c/ee59a6/32.png) [@cseducator\_mindchamp](https://community.thunkable.com/u/cseducator_mindchamp)\
**Post date:** [October 9, 2023, 5:25am UTC](https://community.thunkable.com/t/how-to-set-a-value-to-a-variable-only-once/2634527/1 "2023-10-09T05:25:26Z")

</div>

Hi all ,  
Firstly please excuse me if the topic is not very expressive as I am not sure if I can fit it in lesser words or I can use more words in the title. I need help in - how to create a variable ( which type) and on which screen, so that it is initialized to a value let say 100 only once in lifetime of a user of an app , which has login/singin/signup functionality. Basically I want to give coins( name of the variable) to a user on the sign up/first time user of the app and then while the user is using the app , the value of coins will change as per the functionality of the app, I do not want the coins to be reset to 100 ever then, please help. Kindly tag if there is already a post about the same, will be really helpful.TIA.

---

<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 9, 2023, 5:39am UTC](https://community.thunkable.com/t/how-to-set-a-value-to-a-variable-only-once/2634527/2 "2023-10-09T05:39:22Z")

</div>

You can use a _stored_ variable for this. When the screen opens, check to see if the stored variable equals null. If so, set it to the initial value such as 100. That’s 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:** [January 7, 2024, 5:40am UTC](https://community.thunkable.com/t/how-to-set-a-value-to-a-variable-only-once/2634527/3 "2024-01-07T05:40:10Z")

</div>

Closed on January 7, 2024, 5:40am UTC

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