# Deleting Item from List on Thunkable X

**URL:** <https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, listview\
**Created:** [December 3, 2018, 1:52pm UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180 "2018-12-03T13:52:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![CD\_MA](https://avatars.discourse-cdn.com/v4/letter/c/a587f6/32.png) [@CD\_MA](https://community.thunkable.com/u/CD_MA)\
**Post date:** [December 3, 2018, 1:52pm UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/1 "2018-12-03T13:52:10Z")

</div>

I’m getting an issue with deleting items. The index it seems to select, and therefore delete, is always the one at the top of the list as seen in the screenshots here:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/8/d8dcb2882b145206eaf34fdcc4a8abffa2273ab3.jpeg)

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/3/d33fbd51159ee2f1565743a0a423cb74847d6959.jpeg)

\*\* I was pressing the item at the very bottom (A)

And here’s my codeblock:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/8/f84dff59121c176bec2c272081d8aae238209ac1.png)  
It would be really helpful to receive your input on this. Thank you!

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [December 3, 2018, 3:50pm UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/2 "2018-12-03T15:50:37Z")

</div>

An example works well for me.

 ![%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/a/8a561d9e4e58e0d28c3286414d3823ef0d0aa0e5.png)

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [December 3, 2018, 4:04pm UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/3 "2018-12-03T16:04:16Z")

</div>

No, I jumped to review. I see the oddity. If to remove in this order ADB, then C can only be removed when re-pressing it. When you first click on the remaining C, it is not removed! One remaining item in the list is not deleted the first time.

[https://x.thunkable.com/projects/5bfece2f2ceade68e43fab5b/project/properties/designer/](https://x.thunkable.com/projects/5bfece2f2ceade68e43fab5b/project/properties/designer/)

---

<div class="post-metadata">

**Author:** ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)\
**Post date:** [December 5, 2018, 6:32pm UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/4 "2018-12-05T18:32:10Z")

</div>

I believe the problem is that you are modifying the List\_Viewer2.TextItems and hoping that it will correctly modify the List\_Viewer display. You need to explicitly set the List\_Viewer2.TextItems property to correctly redisplay the List Viewer. See the following for a updated version of @actech’s example: [https://x.thunkable.com/copy/c1d586b791dc3322b90de618f1eddf67](https://x.thunkable.com/copy/c1d586b791dc3322b90de618f1eddf67)

-Mark

---

<div class="post-metadata">

**Author:** ![Reed](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@Reed](https://community.thunkable.com/u/Reed)\
**Post date:** [December 18, 2018, 6:03am UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/5 "2018-12-18T06:03:44Z")

</div>

No, there is still an issue with removing items from a listviewer. Here is my example, trying to carefully implement Mark’s suggestion:  
[https://x.thunkable.com/copy/f3d0699f05bb8cc370ba9fd715ee759c](https://x.thunkable.com/copy/f3d0699f05bb8cc370ba9fd715ee759c)

It still deletes the item below the selection on screen2. Also, you can’t delete the last item. Is this a bug in the List or the listviewer?

---

<div class="post-metadata">

**Author:** ![rojored12](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@rojored12](https://community.thunkable.com/u/rojored12)\
**Post date:** [January 15, 2019, 1:30am UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/6 "2019-01-15T01:30:20Z")

</div>

Is this only works with simple lists like that?  
what about complex lists with multiple columns, i.e. multiple properties (ID, first name, last name, address…) for the same object (list item).  
I’ve been having troubles for a long time removing the whole item from a local.

---

<div class="post-metadata">

**Author:** ![rojored12](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@rojored12](https://community.thunkable.com/u/rojored12)\
**Post date:** [January 15, 2019, 2:55am UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/7 "2019-01-15T02:55:12Z")

</div>

What I meant earlier, in this example, the path leads me to a a list of 3 items containing two properties: Question and Answer, as you can see in the first screenshot.

Then if I want to know if the list has been stored I ask for the length of the list, which is 3; however if I try to display the list in the listviewer, the app crashes everytime. (second screenshot)

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/2/62d2412265f8ec0696a6a94fdf956cb816c5da8d.png)

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

Do you think this could be the reason why I am having troubles removing items from lists properly?

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

FYI: in the last screenshot, 1) the reason behind why to find first and then remove was because it worked like that for another user having issues removing items from lists, however idk if his lists are like mine; 2) the reason why I use the variable “app discard” and then sustract 1, is because on that list I have another property which is a sequential number for all the items in my list, so I sustract 1 simulating the index number of that item on the list.

---

<div class="post-metadata">

**Author:** ![Dennis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dennis/32/30148_2.png) [@Dennis](https://community.thunkable.com/u/Dennis)\
**Post date:** [January 15, 2019, 9:35am UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/8 "2019-01-15T09:35:32Z")

</div>

I didn’t read to your complete code but yesterday I experienced similiar issues if the index you want to remove is 0 (even though the list counter starts at 1). I expected that in this case the “in list remove” command would not remove any item in the list. I’m pretty sure thas this behaviour is not intended.  
I used it in combination with “find first occurence of item”.

Example: [https://x.thunkable.com/copy/7edfd4588c78b1ec2d52ba5c62a8177b](https://x.thunkable.com/copy/7edfd4588c78b1ec2d52ba5c62a8177b)

---

<div class="post-metadata">

**Author:** ![rojored12](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@rojored12](https://community.thunkable.com/u/rojored12)\
**Post date:** [January 16, 2019, 2:01am UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/9 "2019-01-16T02:01:31Z")

</div>

I used your blocks with my own list downloaded from realtimedb (just as my original app), and you are right, when the list item (either original or the new one resulting from the removing of items) is now index 0, it is “removed” from the length of the list, but it is still displayed on the labels, hence… duplicated results in the get random.

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

---

<div class="post-metadata">

**Author:** ![ramya.cse.2008u](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@ramya.cse.2008u](https://community.thunkable.com/u/ramya.cse.2008u)\
**Post date:** [July 3, 2021, 6:05am UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/12 "2021-07-03T06:05:14Z")

</div>

I tried this code blocks on a simple list viewer and it worked without any bugs. 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:** [July 3, 2021, 7:12am UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/13 "2021-07-03T07:12:53Z")

</div>

You’re responding on a 2 year old post. There is no benefit from such response and you are bumping up old posts

---

<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, 11:52am UTC](https://community.thunkable.com/t/deleting-item-from-list-on-thunkable-x/59180/14 "2024-11-08T11:52:19Z")

</div>


