# Find first of a non existent item still causes deletion

**URL:** <https://community.thunkable.com/t/find-first-of-a-non-existent-item-still-causes-deletion/1054801>\
**Category:** Feedback\
**Created:** [January 18, 2021, 12:41am UTC](https://community.thunkable.com/t/find-first-of-a-non-existent-item-still-causes-deletion/1054801 "2021-01-18T00:41:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![magwa101](https://avatars.discourse-cdn.com/v4/letter/m/b9bd4f/32.png) [@magwa101](https://community.thunkable.com/u/magwa101)\
**Post date:** [January 18, 2021, 12:41am UTC](https://community.thunkable.com/t/find-first-of-a-non-existent-item-still-causes-deletion/1054801/1 "2021-01-18T00:41:28Z")

</div>

![Screen Shot 2021-01-17 at 4.15.39 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/1/91be8e4802243786d8adfe1e4c79c2da66f4b931.png)

I am looking up an item in a list, an item I have just removed. I expect it to return 0 so that the next remove that I try will not do anything, but in fact it removes another item.  
Ex. select “book2” in the ListViewer, click “COButton”, it removes “book2” at index 2 appropriately. However, if I click the “COButton” again, it then removes “book3”. That does not make sense to me.

I am testing in the browser, not the phone.

---

<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 18, 2021, 2:04am UTC](https://community.thunkable.com/t/find-first-of-a-non-existent-item-still-causes-deletion/1054801/2 "2021-01-18T02:04:03Z")

</div>

Sure enough, removing the 0th item from a list in fact removes an existing item:

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

I’m guessing this bug has been reported before but I couldn’t find it on the forums.

You’ll have to use an if/then block to first check if the item is found and then remove it only if it’s found.

---

<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 18, 2021, 4:49am UTC](https://community.thunkable.com/t/find-first-of-a-non-existent-item-still-causes-deletion/1054801/3 "2021-01-18T04:49:14Z")

</div>

It seemed to me you are duplicating efforts. You already saved the `index` of the book you want removed so in the` in list .... remove #` just use `app variable BookViewerIndex` which actually points to the item to be removed.

---

<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/find-first-of-a-non-existent-item-still-causes-deletion/1054801/5 "2024-11-08T13:30:40Z")

</div>


