# I want to apply different values for each user

**URL:** <https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319>\
**Category:** Questions about Thunkable X\
**Created:** [February 21, 2022, 5:11am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319 "2022-02-21T05:11:02Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![qortmd3592st](https://avatars.discourse-cdn.com/v4/letter/q/d07c76/32.png) [@qortmd3592st](https://community.thunkable.com/u/qortmd3592st)\
**Post date:** [February 21, 2022, 5:11am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/1 "2022-02-21T05:11:02Z")

</div>

![rr](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/7/47a65118c246c9db75ff2b1dac6a7742ddb657ff.png)

I added 3 different accounts.

Let’s say that the three accounts are different people.

If you click the button 3 times on the first account, the point is 3.  
If you click the button four times on the second account, it’s point four.  
If you click the button 7 times on the third account, it’s point 7.

Like this, I want to save different variables for each other.

 ![d](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/1/6173e2f10bdec3e50b91d75429551c907499dd1c.png)

I made a function like this.

but, points in your account are initialized every time you run the app.

Please help me out on what to do. plzzz

---

<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:** [February 21, 2022, 5:56am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/2 "2022-02-21T05:56:09Z")

</div>

You need to use the cloud variable path to the number of points node in Firebase. When you click the button, change the firebase value.

Use cloud variables, not app variables.

---

<div class="post-metadata">

**Author:** ![qortmd3592st](https://avatars.discourse-cdn.com/v4/letter/q/d07c76/32.png) [@qortmd3592st](https://community.thunkable.com/u/qortmd3592st)\
**Post date:** [February 21, 2022, 6:07am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/3 "2022-02-21T06:07:39Z")

</div>

That’s how there was an error. Can you tell me through a picture?

---

<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:** [February 21, 2022, 7:31am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/4 "2022-02-21T07:31:30Z")

</div>

When the button is clicked, first read the value of `points` in Firebase then add the new points to it and then save it back to Firebase,

---

<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:** [February 21, 2022, 8:04am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/5 "2022-02-21T08:04:57Z")

</div>

> [@qortmd3592st](#):
>
> Can you tell me through a picture?

It would be something like this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/4/7476f8997dec789bc87e319d2201e5bc84d1b8f0.png)

---

<div class="post-metadata">

**Author:** ![qortmd3592st](https://avatars.discourse-cdn.com/v4/letter/q/d07c76/32.png) [@qortmd3592st](https://community.thunkable.com/u/qortmd3592st)\
**Post date:** [February 21, 2022, 8:48am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/6 "2022-02-21T08:48:03Z")

</div>

thank you for your help

![kk](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/7/77aa29a830292cb231a0478682a522eb752f2c2d.png)

However, if I use this block first and save it to the database and set the block you mentioned, it seems to work properly.

What should I save these points as? If you do not fill in the blanks, you cannot enter point values.

If I set a random number, it will change to a random number every time the app is run. No saving

Which block should I put in?

help me …

---

<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:** [February 21, 2022, 5:03pm UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/7 "2022-02-21T17:03:57Z")

</div>

You should create the object with a score value of zero. But you need to create the object when the user first signs up, not when the button is clicked.

---

<div class="post-metadata">

**Author:** ![qortmd3592st](https://avatars.discourse-cdn.com/v4/letter/q/d07c76/32.png) [@qortmd3592st](https://community.thunkable.com/u/qortmd3592st)\
**Post date:** [February 21, 2022, 11:20pm UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/8 "2022-02-21T23:20:10Z")

</div>

Then, how do I set the code?

If you set it as a signs up, information is stored as the last registered account, not as a login account.

---

<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:** [February 21, 2022, 11:48pm UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/9 "2022-02-21T23:48:52Z")

</div>

Sorry, I misspoke. When a user signs in with Firebase, Thunkable provides a green block called userId. You can check to see if User/userId exists (is not null) and if it doesn’t, then create an object. That way, the object only gets created one time, the first time the user signs in to your app.

---

<div class="post-metadata">

**Author:** ![qortmd3592st](https://avatars.discourse-cdn.com/v4/letter/q/d07c76/32.png) [@qortmd3592st](https://community.thunkable.com/u/qortmd3592st)\
**Post date:** [February 21, 2022, 11:55pm UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/10 "2022-02-21T23:55:56Z")

</div>

Can you show us the picture? It’s confusing.

---

<div class="post-metadata">

**Author:** ![qortmd3592st](https://avatars.discourse-cdn.com/v4/letter/q/d07c76/32.png) [@qortmd3592st](https://community.thunkable.com/u/qortmd3592st)\
**Post date:** [February 22, 2022, 11:52am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/11 "2022-02-22T11:52:27Z")

</div>

Even if I find it myself and make a code, an error appears. Give them a hand. ㅔplzzz

---

<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:** [February 22, 2022, 4:56pm UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/12 "2022-02-22T16:56:08Z")

</div>

Try this. I would test it without the Navigate block. You might need a slight delay between the cloud variable block and the Navigate block so leave it out for now. If the =null condition doesn’t trigger when you first sign in, then you may have to check the properties of Users/ or whatever your top Firebase level is for the existence of [user id] but I think the =null condition will work. Make sure you are using an account that has been verified by clicking the link your receive from Firebase in your email account.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/7/87f9d042ae28d07d471c11c888d82d981112106d.png)

---

<div class="post-metadata">

**Author:** ![qortmd3592st](https://avatars.discourse-cdn.com/v4/letter/q/d07c76/32.png) [@qortmd3592st](https://community.thunkable.com/u/qortmd3592st)\
**Post date:** [February 23, 2022, 5:36am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/13 "2022-02-23T05:36:15Z")

</div>

I love you. If you were next to me, I would kiss you even a million times. Thank you so much. You’re a genius.

---

<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:** [February 23, 2022, 5:49am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/14 "2022-02-23T05:49:20Z")

</div>

Well… you’re welcome!

---

<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:** [May 24, 2022, 5:49am UTC](https://community.thunkable.com/t/i-want-to-apply-different-values-for-each-user/1745319/15 "2022-05-24T05:49:48Z")

</div>

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