# Unable to delete the last node in firebase

**URL:** <https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815>\
**Category:** Questions about Thunkable X\
**Created:** [January 29, 2022, 3:45pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815 "2022-01-29T15:45:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 29, 2022, 3:45pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/1 "2022-01-29T15:45:21Z")

</div>

hi  
I’m sure I read in a post that I could do this

 ![Capture d’écran 2022-01-29 à 16.40.47](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/a/faa1aae7367d0d1652400c47e1b574d4d3f20279.png)

to delete that

 ![Capture d’écran 2022-01-20 à 06.45.37](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/b/3b5fa5a474ca950f94458a6fc4751a5664c3e8c3.png)

i read wrong ?

update :  
it works as long as there is more than one element left to delete, it’s the last one that gets stuck

---

<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:** [January 29, 2022, 4:23pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/2 "2022-01-29T16:23:06Z")

</div>

Set **connected** to **null**

Will delete all nodes under **connected** in one single command.

---

<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:** [January 29, 2022, 5:43pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/3 "2022-01-29T17:43:06Z")

</div>

@muneer, that will also remove “connected” won’t it?

Could you set cloud variable connected to an empty string or empty list? I haven’t tried that but it might work.

---

<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:** [January 29, 2022, 5:56pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/4 "2022-01-29T17:56:00Z")

</div>

Actually when you set a `node` to anything you like it will overwrite whatever value it holds whether it is a simple value or a complete structure.

So you can choose to set it to a default value that you specify.

---

<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:** [January 29, 2022, 6:13pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/5 "2022-01-29T18:13:44Z")

</div>

I supposed I was trying to make a distinction between deleting the node, which will occur if you set “connected” to null, and setting the node’s value to an empty string which will keep the “connected” node.

But really, it doesn’t matter because either way, when you want to repopulate the node, you have to use the full path to the node in Thunkable (connected/\_\_\_\_\_\_) so it gets created anyway.

Probably cleaner to just set the node to null as you suggested.

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 29, 2022, 7:17pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/6 "2022-01-29T19:17:07Z")

</div>

hi

i set connected to null and the app crashes

---

<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:** [January 29, 2022, 7:23pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/7 "2022-01-29T19:23:16Z")

</div>

> [@bibbi](#):
>
> i set connected to null and the app crashes

You will need to provide a lot more information!

---

<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:** [January 29, 2022, 7:38pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/8 "2022-01-29T19:38:56Z")

</div>

> [@bibbi](#):
>
> the app crashes

It would most probably happen not due to setting the master bucket (node) to null but the app retrieves information from such node and act upon it without testing if it is null or not.

If you assign a `label` a null value, nothing will happen but if you try to assign an object or a list then the app would crash.

Hope this clarifies the matter. This is only my assumption as you need to give enough details to get a more detailed and relevant answer.

---

<div class="post-metadata">

**Author:** ![bibbi](https://avatars.discourse-cdn.com/v4/letter/b/db5fbb/32.png) [@bibbi](https://community.thunkable.com/u/bibbi)\
**Post date:** [January 29, 2022, 8:47pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/9 "2022-01-29T20:47:41Z")

</div>

indeed my application did not take into account this new writing to erase the last node

---

<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:** [April 29, 2022, 8:48pm UTC](https://community.thunkable.com/t/unable-to-delete-the-last-node-in-firebase/1703815/10 "2022-04-29T20:48:35Z")

</div>

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