# Can someone help me to solve my firebase problem?

**URL:** <https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, beginner\
**Created:** [July 27, 2019, 10:25pm UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739 "2019-07-27T22:25:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tccfemme](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tccfemme](https://community.thunkable.com/u/tccfemme)\
**Post date:** [July 27, 2019, 10:25pm UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/1 "2019-07-27T22:25:33Z")

</div>

Hi guys, can someone help me with my final project for school? I really need to know why my code is not functioning like I need it to. So my app is conected to a db on firebase and my intention is to make a list then send it, but instead of going as a list the last item continues to overwrite above the rest. I don’t know if you can understand, but here are some pictures to explain better. I have little time to finish this so thanks in advance.

 ![Captura%20de%20Tela%20(2)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/f/efd824967b5701126a52b40864e65486dd76a7ad.png) ![Captura%20de%20Tela%20(3)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/3/d36381bf349dd7509683ca68e603fdbfd49e22e4.png) ![Captura%20de%20Tela%20(4)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/5/f56e27bced026f25d61c0dffbc140ad6226dab92.png)

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [July 27, 2019, 10:44pm UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/2 "2019-07-27T22:44:52Z")

</div>

Each time you start the app, it assumes it is the first time, having the “lista\_emergencia” defined as an empty list.

If you want to be able to add to it, you need to preserve that WHOLE list, like retrieving the value from the database before appending to _it_, as opposed to appending to the empty list.

---

<div class="post-metadata">

**Author:** ![tccfemme](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tccfemme](https://community.thunkable.com/u/tccfemme)\
**Post date:** [July 27, 2019, 10:52pm UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/3 "2019-07-27T22:52:29Z")

</div>

Thank you very much, I’ll try to do it

---

<div class="post-metadata">

**Author:** ![tccfemme](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tccfemme](https://community.thunkable.com/u/tccfemme)\
**Post date:** [July 27, 2019, 11:13pm UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/4 "2019-07-27T23:13:20Z")

</div>

Sorry, I can’t get myself to do it… Should this work? When I send it, the value doesn’t get to firebase

 ![Captura%20de%20Tela%20(5)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/c/9cb21515d6b9decec679cc2dad5aa7979a098e0d.png)

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [July 28, 2019, 12:12am UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/5 "2019-07-28T00:12:53Z")

</div>

No, that won’t work.  
You need to provide the key and to add the logic to address the case where “Get” comes back empty handed because that is the first time the program is ever run and that that record does not yet exist.

---

<div class="post-metadata">

**Author:** ![tccfemme](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tccfemme](https://community.thunkable.com/u/tccfemme)\
**Post date:** [July 28, 2019, 1:44am UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/6 "2019-07-28T01:44:57Z")

</div>

Oh of course… sorry, in my print It seems that I didn’t provide any key, but even why I did It didn’t work ://

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [July 28, 2019, 2:06am UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/7 "2019-07-28T02:06:44Z")

</div>

Have you included the logic for the first run, when the “Get” finds no record?

---

<div class="post-metadata">

**Author:** ![tccfemme](https://avatars.discourse-cdn.com/v4/letter/t/58956e/32.png) [@tccfemme](https://community.thunkable.com/u/tccfemme)\
**Post date:** [July 28, 2019, 3:18pm UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/8 "2019-07-28T15:18:22Z")

</div>

I don’t know if I understood it right because I’m not good in english, but here are the results: The list just doesn’t seem to be right

 ![Captura%20de%20Tela%20(7)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/c/5c24ffaba79bbd8fe3e1ac1d85a5ebb8f41b6cdf.png) ![Captura%20de%20Tela%20(6)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/7/b7bb14f0a7440edbc5845616eedaa10ea33a2e80.png)

Thank you so much for trying to help me though, you’re the main reason I didn’t freak ou yet. I actually have another screen in this app with almost the same code but It does work quite well as I intended, different from this one.

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [July 28, 2019, 5:16pm UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/9 "2019-07-28T17:16:31Z")

</div>

In your Get block, I am not sure that, if the record is not found, that value is returned as ‘null’ (though it is possible it does); my point is that most look for ‘error’ to not be true,  
But, if the value is not null, then it is ALREADY a list. By having a “list” conversion, you are turning the result into a list of a list, which is not what you want.app lista\_emergencia should be made directly equal to ‘value’, without the “list” instruction.

---

<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, 12:12pm UTC](https://community.thunkable.com/t/can-someone-help-me-to-solve-my-firebase-problem/158739/10 "2024-11-08T12:12:06Z")

</div>


