# Remove item from firebase using cloud variables

**URL:** <https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420>\
**Category:** Questions about Thunkable X\
**Tags:** firebase, beginner\
**Created:** [August 5, 2021, 11:32am UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420 "2021-08-05T11:32:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreas.sjdtomypv](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@andreas.sjdtomypv](https://community.thunkable.com/u/andreas.sjdtomypv)\
**Post date:** [August 5, 2021, 11:32am UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/1 "2021-08-05T11:32:46Z")

</div>

Hi  
I am trying to build (rebuild) my app using cloud variables for practice. It’s a really basic app, with functions like add items to a list, remove items from the list and edit items in the list. So far it works fine, but now I am at the step where to remove an item. The list I am using for view my items is an DVL.  
The issue is how to remove an specific item in the list in Firebase.  
I would need some index for that I guess and I have trying a few things to get that out but now I think I would need some help.

Here is my Firebase list:  
 ![Screenshot 2021-08-05 at 13.23.50](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/c/cca91d6f2eb28baf2df53fa32da80e64efcfd97b.png)

here is my code for “swipe-delete”:

 ![Screenshot 2021-08-05 at 13.29.09](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/8/48b5e0c31e83d95b345baef9229baff862028816.png)

The idea with this code was to,

- get the value from the row I am at
- count through my list until I can find any item there which match that value
- remove that value from my list and view the result in a label just for testing.

(I thought I would try this with local list first before going to cloud).

Any help is really appreciated. Thanks!  
/

---

<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:** [August 5, 2021, 11:45am UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/2 "2021-08-05T11:45:45Z")

</div>

This should replace the loop you are using

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

I’m not sure what you want to do but if you have a list of values and you want to remove a specific value then you can use these 2 blocks to do the job.

---

<div class="post-metadata">

**Author:** ![andreas.sjdtomypv](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@andreas.sjdtomypv](https://community.thunkable.com/u/andreas.sjdtomypv)\
**Post date:** [August 5, 2021, 11:51am UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/3 "2021-08-05T11:51:55Z")

</div>

ok thanks, yes I simply want to remove for example “Item 2” in my list. But I guess I can use a variable for that in that “text to search for” instead of type “Item 2” manually? I will try this! Thanks!

---

<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:** [August 5, 2021, 11:53am UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/4 "2021-08-05T11:53:18Z")

</div>

> [@andreas.sjdtomypv](#):
>
> But I guess I can use a variable for that in that “text to search for” instead

Yes, absolutely.  
I was just showing a quick example.

---

<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:** [August 5, 2021, 12:03pm UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/5 "2021-08-05T12:03:30Z")

</div>

Another improvement on your code, if “Items” column is already displayed in the DVL then you can use it this way  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/1/8100f8843f43f32af8dfcda34292d9cac415cc5d.png)

In my example I am taking the value from the “Title” label of the DVL hence avoiding the call to the local DB. This would be much faster than going back to the local DB.

---

<div class="post-metadata">

**Author:** ![andreas.sjdtomypv](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@andreas.sjdtomypv](https://community.thunkable.com/u/andreas.sjdtomypv)\
**Post date:** [August 5, 2021, 12:06pm UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/6 "2021-08-05T12:06:51Z")

</div>

oh yea, thanks! I’ll try. I didn’t get the first example work really (Nothing happens) so I am troubleshooting at the moment, but maybe this can help! Thanks!

---

<div class="post-metadata">

**Author:** ![andreas.sjdtomypv](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@andreas.sjdtomypv](https://community.thunkable.com/u/andreas.sjdtomypv)\
**Post date:** [August 5, 2021, 12:19pm UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/7 "2021-08-05T12:19:08Z")

</div>

Maybe you have an idea what’s missing?  
So, I am adding items to my list in the cloud. They are at firebase RTB, I can see them.  
I have “found” the text for the row id that I want to delete by using your example above. I put that text in a variable (“tempInputText”) and display this in a label which indicates that this works.  
Then I am running your example above for how to remove that text from my cloud-list.  
But nothing is happening to my list. Am I missing anything? To I need to somehow “refresh” or sync it?  
Thanks

 ![Screenshot 2021-08-05 at 14.13.16](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/b/1b7bf0f1cab099cb53b5c0f93646bfd4f42730d1.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:** [August 5, 2021, 12:39pm UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/8 "2021-08-05T12:39:45Z")

</div>

The image you shared in your fist post for FB content showing a **text** not a **list**. So I assume you are converting it to a list somewhere not in the blocks you shared. If you have not converted it to a list then this trick will not work.

I also noticed that you are using a list inside a list. See this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/4/2450c99c903d9823fe8570eba8d627bae42bb0e8.png)

---

<div class="post-metadata">

**Author:** ![andreas.sjdtomypv](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@andreas.sjdtomypv](https://community.thunkable.com/u/andreas.sjdtomypv)\
**Post date:** [August 5, 2021, 12:42pm UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/9 "2021-08-05T12:42:28Z")

</div>

Ah ok I understand… Thanks

---

<div class="post-metadata">

**Author:** ![andreas.sjdtomypv](https://avatars.discourse-cdn.com/v4/letter/a/e5b9ba/32.png) [@andreas.sjdtomypv](https://community.thunkable.com/u/andreas.sjdtomypv)\
**Post date:** [August 6, 2021, 11:33am UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/10 "2021-08-06T11:33:27Z")

</div>

I just thought I would share the solution at last.  
This made it work for me, Thanks Muneer for your help. I indeed had to convert it to a list and then back to text again to make it work for my cloud variable as the cloud variables only access clean text.

 ![Screenshot 2021-08-06 at 13.32.33](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/b/cbee29dd48f73b018dd96d40ea51ddd32ece6041.png)

---

<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:17pm UTC](https://community.thunkable.com/t/remove-item-from-firebase-using-cloud-variables/1432420/11 "2024-11-08T13:17:32Z")

</div>


