# Deleting multiple values in Firebase at once

**URL:** <https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, realtimedb\
**Created:** [December 10, 2020, 9:42am UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700 "2020-12-10T09:42:36Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![antje.smilesyft](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/antje.smilesyft/32/67780_2.png) [@antje.smilesyft](https://community.thunkable.com/u/antje.smilesyft)\
**Post date:** [December 10, 2020, 9:42am UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/1 "2020-12-10T09:42:36Z")

</div>

Hi everyone,  
I understand that deleting values in Firebase is nothing else than updating them to “null” and that sounds simple enough. However, I would like to delete/update 30 values at the same time when a button gets clicked and instead of updating every single one of them, I would love to instead just say "delete all values that you can find under xyz.

For example:

 ![Screenshot 2020-12-09 at 21.28.43](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/1/21bb0d6430129fa43ed00c5bb15ac1cc09321614.jpeg)

I would like to “null” all 30 key/value pairs that are sitting underneath the user ID in the screenshot.  
Is there a better/easier/faster way to achieve this rather than going like:  
'1. In Realtime DB call Save Workout\_Weight/userID/nick\_abductionmachine value to null  
'2. In Realtime DB call Save Workout\_Weight/userID/nick\_backextension value to null  
[…]  
'29.  
'30. In Realtime DB call Save Workout\_Weight/userID/… value to null

Thanks a lot,  
Antje 🙂

---

<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:** [December 10, 2020, 10:48am UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/2 "2020-12-10T10:48:08Z")

</div>

You can set any level of the JSON tree to a null, erasing everything below it.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/6/167c4e55bee1abf8a036964936003c9f39cdeb7c.png)

Also notice I used the CLOUD variable block instead of the RealtimeDB SAVE block. Just use the RealtimeDB KEY as the Variable name in the SET CLOULD block. Boom! No asynchronous issues! You can do the same for the GET block.

Happy Thunking!

---

<div class="post-metadata">

**Author:** ![antje.smilesyft](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/antje.smilesyft/32/67780_2.png) [@antje.smilesyft](https://community.thunkable.com/u/antje.smilesyft)\
**Post date:** [December 10, 2020, 7:59pm UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/3 "2020-12-10T19:59:07Z")

</div>

Nice, thank you very much!  
And thanks for the hint with regards to CLOUD variables. I saw it in the documentation but was hesitant and solved some asynchronous issues through functions. Sounds like it’s worth looking into though.

Thanks again!

---

<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:** [December 10, 2020, 9:10pm UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/4 "2020-12-10T21:10:17Z")

</div>

No need to replace existing blocks, you can mix and match for a phased change

---

<div class="post-metadata">

**Author:** ![antje.smilesyft](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/antje.smilesyft/32/67780_2.png) [@antje.smilesyft](https://community.thunkable.com/u/antje.smilesyft)\
**Post date:** [December 19, 2020, 1:03pm UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/5 "2020-12-19T13:03:27Z")

</div>

Hi there, I just started saving values using the Cloud variable now instead of the Realtime DB Save block and it works flawlessly.  
I don’t find the documentation very helpful and am now a bit lost how to change my GET blocks accordingly, as you suggested using the Cloud variable can help with asynchronous issues that I have formerly seen with the Realtime DB GET block.  
Can you maybe point me the right way?  
Thank you,  
Antje

---

<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:** [December 19, 2020, 1:10pm UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/6 "2020-12-19T13:10:23Z")

</div>

Let’s say you have a get block like this:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/e/dea7b0d879132c3c4aa6cb38f4b2c008efdfcb7c.png)

Keep the “key” parameter the same when you use the cloud variable block. Use the key value as the cloud variable name, just like you did when changing from the SAVE block.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/0/e0edeee9b27dbeaa989613ba34f66c8f8eaf30fe.png)

There is no error block using cloud variables. Anything you have in the THEN DO section can be moved to after the Set block.

If you can share a specific example of just one GET block you are trying to convert, I can try to give more specific suggestions.

---

<div class="post-metadata">

**Author:** ![antje.smilesyft](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/antje.smilesyft/32/67780_2.png) [@antje.smilesyft](https://community.thunkable.com/u/antje.smilesyft)\
**Post date:** [December 21, 2020, 8:12pm UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/7 "2020-12-21T20:12:28Z")

</div>

Perfect, thank you so much! Works great!

---

<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 17, 2021, 3:59am UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/8 "2021-01-17T03:59:52Z")

</div>

This is very helpful, is there a way to quickly create multiple values, or multiple objects at once?

---

<div class="post-metadata">

**Author:** ![luv.ak.tech](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/luv.ak.tech/32/104896_2.png) [@luv.ak.tech](https://community.thunkable.com/u/luv.ak.tech)\
**Post date:** [January 17, 2021, 4:22am UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/9 "2021-01-17T04:22:50Z")

</div>

yes as @drted mentioned he did it to null instead of null put the value you want

---

<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 17, 2021, 2:47pm UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/10 "2021-01-17T14:47:30Z")

</div>

No that doesn’t create multiple objects, just 1 object.

I’m wondering if there’s a way to create multiple objects at the same time.

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

Like the screenshot above should make this result below (I manually made this result for illustrative purposes, it doesn’t actually work this way currently)  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/c/3c7079823da9a20171d96068d2d268b7523f2d4e.png)

---

<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 17, 2021, 2:50pm UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/11 "2021-01-17T14:50:22Z")

</div>

Never mind, figured it out. I forgot how handy for each item j is…

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

Happy Thunking!

---

<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:19pm UTC](https://community.thunkable.com/t/deleting-multiple-values-in-firebase-at-once/1031700/12 "2024-11-08T12:19:35Z")

</div>


