# When a new user creates an account, I need to copy the Firebase DB

**URL:** <https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, database, login\
**Created:** [January 10, 2021, 7:34pm UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839 "2021-01-10T19:34:19Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [January 13, 2021, 8:15pm UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/25 "2021-01-13T20:15:15Z")

</div>

You mean for task2?  
No those are not even being detected in the output

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [January 13, 2021, 9:09pm UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/26 "2021-01-13T21:09:01Z")

</div>

Can you share a screenshot of the output?

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [January 13, 2021, 9:28pm UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/28 "2021-01-13T21:28:51Z")

</div>

![Screenshot_20210113-152628~2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/a/9aaf4799d7a9ec7133d166eafc42e97b3fce67ea.png)

I changed my default to !!! !!Default so it will always be at the top of my DB, I’m sure only 1 ! would have sufficed but it’s what I did

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [January 13, 2021, 9:34pm UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/29 "2021-01-13T21:34:59Z")

</div>

Sorry, you’re on your own on that one

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [January 13, 2021, 9:39pm UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/30 "2021-01-13T21:39:34Z")

</div>

You mean you don’t know why it’s not adding the task2?

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [January 14, 2021, 3:17pm UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/31 "2021-01-14T15:17:09Z")

</div>

I fixed my 5! so now default just says !Default. I was thinking for some reason in case the user’s email address started with more than one ! they would have a chance of being at the top of my DB in Firebase. But then I realized the userIDs which are created are specifically all alphanumeric

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [January 15, 2021, 5:43am UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/32 "2021-01-15T05:43:48Z")

</div>

For some reason, when there’s a lot of data involved, this doesn’t update EXISTING users data.

I’ve tried it on a button press event and if I spam the button 4 or 5 times I can get it to update existing users, but if I just leave it on a ‘when screen opens’ component it won’t do it. I’ve tried putting in some wait 1 sec components all over the place during the function with no luck.

Any suggestions?

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [February 1, 2021, 1:57am UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/33 "2021-02-01T01:57:47Z")

</div>

This is where I’m at for now with this…

If a user is missing a task, it will be added as intended, but it also reverts all the users other saved tasks back to the default, removing all of their progress…  
Any suggestions?

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

---

<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 1, 2021, 11:46am UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/34 "2021-02-01T11:46:22Z")

</div>

From your blocks,

You are checking for the existence of the subtask and if Null then instead of creating the subtask you are writing back the whole task which will overwrite any existing subtasks along with creating the missing subtask.

---

<div class="post-metadata">

**Author:** ![overshield](https://avatars.discourse-cdn.com/v4/letter/o/e19b73/32.png) [@overshield](https://community.thunkable.com/u/overshield)\
**Post date:** [February 2, 2021, 12:47am UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/35 "2021-02-02T00:47:54Z")

</div>

Ok I see @muneer , all I needed to do was change the set property \> subcatj and then also set it to get property subcatj of object categoryiesj of object mastertaskobject.

Thank you for your help.

Now at this point it is also checking every single user when 1 user logs in. It doesn’t need to do that, it only needs to be checking _the current user_ against the !Default

---

<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:30pm UTC](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839/36 "2024-11-08T13:30:55Z")

</div>

Closed on November 8, 2024, 1:30pm UTC



[Previous page](https://community.thunkable.com/t/when-a-new-user-creates-an-account-i-need-to-copy-the-firebase-db/1043839.md?page=1)
