# Save data to a specific user in firebase

**URL:** <https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, database, beginner, username\
**Created:** [September 24, 2021, 7:17am UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639 "2021-09-24T07:17:39Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodama](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rodama/32/112073_2.png) [@rodama](https://community.thunkable.com/u/rodama)\
**Post date:** [September 24, 2021, 7:17am UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/1 "2021-09-24T07:17:39Z")

</div>

![Prueba2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/e/1e861d35798d31540db7f74f1c6d66bcc48c8566.png)

 ![Prueba1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/9/4953d7f34f2beefa4c9c8a048a6035fe986c3394.png)  
Hi, everyone! In advance, I really thank you for your time and patience.  
I have created users in firebase from my register screen but now I want to save data (scores) from another screeen for each user. Despite the fact that I have read documentation, search for help in tutorials and dedicated time to solve it for myself, I will be happy if I can get some help from you, thunkers.

---

<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:** [September 24, 2021, 9:40am UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/2 "2021-09-24T09:40:26Z")

</div>

First you need to create an `app variable` to hold the `userId` in the login / registration screen.  
Then in the other screen use this variable to generate the key for the firebase entry.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/9/298c42f4e0d111ac655840916d6d72bb8dd772a8.png)

---

<div class="post-metadata">

**Author:** ![rodama](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rodama/32/112073_2.png) [@rodama](https://community.thunkable.com/u/rodama)\
**Post date:** [September 24, 2021, 2:54pm UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/3 "2021-09-24T14:54:00Z")

</div>

I can’t thank you enough for your diligent help. I did exactly what you told me and it has worked perfectly. Thank you for your support.

---

<div class="post-metadata">

**Author:** ![rodama](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rodama/32/112073_2.png) [@rodama](https://community.thunkable.com/u/rodama)\
**Post date:** [September 24, 2021, 10:36pm UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/4 "2021-09-24T22:36:04Z")

</div>

![prueba1.2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/3/235b37be440aa629e8b388b5183f3db3bcf920aa.png)

 ![Prueba1.1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/9/6944816498e21f1660ed541f1ee4a8af9270f760.png)  
@muneer I am sorry for keeping asking basic questions. These are my blocks but for some reason the scores are overwritten. Do you know what am doing wrong?

Once again, thank you very much for your pricesless help

---

<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:** [September 25, 2021, 7:35am UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/5 "2021-09-25T07:35:31Z")

</div>

Yes, this is correct.  
Under `scores` you are saving some values. Every time you call the `Save block`, you are overwriting existing values.

You have two options:

- Use counters for the `scores` to avoid overwriting. Example score/1, score/2, score/3 so that every time you increase the number and you will have your scores saved under the number not directly under the `score` key.

- Use lists. In the object under `scores` don’t save the score variable directly but save a list of scores and every time you update the list. When you save, the updated list will be saved.

Let me know if you need more clarification.

---

<div class="post-metadata">

**Author:** ![rodama](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rodama/32/112073_2.png) [@rodama](https://community.thunkable.com/u/rodama)\
**Post date:** [September 25, 2021, 8:49pm UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/6 "2021-09-25T20:49:33Z")

</div>

I am feeling bad for bothering but do you allow me to direct message you, mr. @muneer ?

---

<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:** [September 25, 2021, 9:10pm UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/7 "2021-09-25T21:10:39Z")

</div>

If you feel you want to discuss your project details privately, feel free to send me direct messages.

---

<div class="post-metadata">

**Author:** ![kgoel6207u](https://avatars.discourse-cdn.com/v4/letter/k/c68b51/32.png) [@kgoel6207u](https://community.thunkable.com/u/kgoel6207u)\
**Post date:** [February 9, 2022, 4:19am UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/8 "2022-02-09T04:19:39Z")

</div>

Hello @muneer, Thank you for such a nice solution - I was also going through the same problem, But can’t get the block of call the database\> Please help me with it!

---

<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 9, 2022, 4:29am UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/9 "2022-02-09T04:29:25Z")

</div>

You can use cloud variables with Firebase instead of the Readtime DB blocks. There are some examples here: [Replace GET or SAVE Blocks with cloud variables](https://community.thunkable.com/t/replace-get-or-save-blocks-with-cloud-variables/975738).

It’s hard to help someone when they say they have “the same problem” without sharing what they’ve tried. Screenshots or a link to a project are really helpful.

---

<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, 1:15pm UTC](https://community.thunkable.com/t/save-data-to-a-specific-user-in-firebase/1523639/10 "2024-11-08T13:15:07Z")

</div>


