# \[Solved\] how can I save user points to the users device?

**URL:** https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652
**Category:** Questions about Thunkable X
**Tags:** solved
**Created:** [April 24, 2022, 8:55am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652 "2022-04-24T08:55:31Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 24, 2022, 8:55am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/1 "2022-04-24T08:55:31Z")

</div>

Hi all!

In my app, I need to save a number that a label is changed to, so that when the user leaves and re-enters the app, they number is still the same, instead of being reset to 0. In more detailed manner, I am saying that I have made point system. I want the points to remain same after restarting the app instead of going back to zero

---

<div class="post-metadata">

### Author: ![barnwalvivaanthunk3c](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@barnwalvivaanthunk3c](https://community.thunkable.com/u/barnwalvivaanthunk3c)
#### Post date: [April 24, 2022, 9:35am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/2 "2022-04-24T09:35:11Z")

</div>

You can save the value in localStorage or any other data sources if you want it on the “cloud”.

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 24, 2022, 9:58am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/3 "2022-04-24T09:58:43Z")

</div>

Hi thanks for the reply  
can you send the code for it

---

<div class="post-metadata">

### Author: ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)
#### Post date: [April 24, 2022, 1:17pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/5 "2022-04-24T13:17:35Z")

</div>

Please stop spamming the forum by asking for the same thing over and over again.

As you’re new it’s best to try something yourself instead of asking for ready made code. That way you will learn something.

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 24, 2022, 1:28pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/6 "2022-04-24T13:28:27Z")

</div>

i already tried man’  
and i literally asked after2-3 hours because i hav a due date for my project

---

<div class="post-metadata">

### Author: ![Dean\_Artis](https://avatars.discourse-cdn.com/v4/letter/d/a8b319/32.png) [@Dean\_Artis](https://community.thunkable.com/u/Dean_Artis)
#### Post date: [April 24, 2022, 2:11pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/7 "2022-04-24T14:11:23Z")

</div>

Show us what you tried.

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [April 25, 2022, 9:39pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/8 "2022-04-25T21:39:03Z")

</div>

Can you show blocks of what you’ve tried so we can guide you better? It’s helpful for others too! 🙂

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 27, 2022, 7:40am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/9 "2022-04-27T07:40:35Z")

</div>

hi will share the code but i hve been getting another error that “internal error generating code from blocks”

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 27, 2022, 7:42am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/10 "2022-04-27T07:42:02Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/9/a9260dc6687868d0429d83b290aa478131a2b85b.png)  
this is the code i tried

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 27, 2022, 7:46am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/11 "2022-04-27T07:46:00Z")

</div>

and also can you give me your discord id so we can talk more easily there

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [April 27, 2022, 10:55am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/12 "2022-04-27T10:55:12Z")

</div>

I’m fairly certain you need to change this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/6/f6ae77ae8d93383c439a47cf15b0a9864229fabd.jpeg)

And instead set the variable when this screen opens using the `screen opens` block

Although it can be plugged into an initialize block, I believe they don’t work that way. You must set the value when using a data source block somewhere other than the initialization block.

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 28, 2022, 10:29am UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/13 "2022-04-28T10:29:58Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/5/15fe1e6fbc3982386fafbfdae05ece418ca1eb36.png)  
now is it fine??

---

<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: [April 28, 2022, 1:03pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/14 "2022-04-28T13:03:58Z")

</div>

You need to fill the `for row id`. Currently it is left blank. You need to put a number. For example use **1** for the first row in your table.

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

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 28, 2022, 2:01pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/15 "2022-04-28T14:01:13Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/d/8dfff49c0074c7a3f3059e66c3ee2424017b5973.png)  
when im previewing the value is coming 0 only

---

<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: [April 28, 2022, 2:12pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/16 "2022-04-28T14:12:55Z")

</div>

The problem is that you are storing the score in two places: a variable and a data source but not updating both when the user enters a different score.

Move the Update Value block up one spot. You need to update the data source _before_ setting the score variable.

If you still can’t get the score to display correctly, provide a link to your project and tell us which screen has the problem.

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 28, 2022, 2:18pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/17 "2022-04-28T14:18:22Z")

</div>

my points worked now

---

<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: [April 28, 2022, 2:31pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/18 "2022-04-28T14:31:17Z")

</div>

Great! Feel free to mark my comment as a solution so this topic gets updated.

---

<div class="post-metadata">

### Author: ![bhavyagupta0910gj6e8](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@bhavyagupta0910gj6e8](https://community.thunkable.com/u/bhavyagupta0910gj6e8)
#### Post date: [April 28, 2022, 2:37pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/19 "2022-04-28T14:37:36Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/2/9235f79dc0713daac6f96b2a2f7558a9ff2835c7.png)  
this is the code that worked

---

<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: [April 28, 2022, 3:43pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/20 "2022-04-28T15:43:17Z")

</div>

Thanks for sharing what worked for you!

---

<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: [July 27, 2022, 3:44pm UTC](https://community.thunkable.com/t/solved-how-can-i-save-user-points-to-the-users-device/1845652/21 "2022-07-27T15:44:15Z")

</div>

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