# \[Solved\] How can I delete only the items in a specific list from a list?

**URL:** <https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473>\
**Category:** Questions about Thunkable X\
**Tags:** solved, lists\
**Created:** [January 11, 2020, 5:16pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473 "2020-01-11T17:16:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [January 11, 2020, 5:16pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/1 "2020-01-11T17:16:51Z")

</div>

![스크린샷 2020-01-12 오전 1.52.06](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/4/647b135ee5895a87d8fa8200870c49857eb51281.png)

I added a specific item in the name3 list to 1re.  
I want to delete the entry that went into 1re from name3.  
What should I do?  
The attached picture does not work as I want.

---

<div class="post-metadata">

**Author:** ![CBVG](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/cbvg/32/32401_2.png) [@CBVG](https://community.thunkable.com/u/CBVG)\
**Post date:** [January 11, 2020, 5:46pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/2 "2020-01-11T17:46:49Z")

</div>

Your problem is a fundamental flaw in the logic.  
Once you figure how to do it, then it will be up to you to decide how else you want to deal with it and address it.

The flaw is as follows:

Suppose you have your name3 list = { A, B, C}  
Then you go in the loop with item “j” being first “A”.  
Note that “j” is not ‘1’ (the number index of “A” in your name3 list) but the VALUE “A”.  
Now, assuming that “A” is indeed a number of seconds since 1970, and that you add “A” at the end of the “1re” list, you are now proceeding to remove this “A” from name3, and that is where this gets double faulty.  
If “A” is NOT an index, and is indeed the number of seconds since 1970 of some recent event, you are trying to remove item #1,550,000,000 in a list. I am pretty sure you do not have a thousand million entries into that list, as it would likely exceed the memory of your device already.  
On the other hand, if “A” is an index and happen to be set to ‘1’ for the first iteration of the loop, you would be removing “A” from the original { A, B, C} list, and therefore name3 would then be {B, C}.  
On the second iteration of the loop, the one that wants to process (and remove) “B”, you would be looking at removing the _ **second** _ entry from what is the updated name3, and that happens to be “C” (i.e. NOT “B”).

What you should do is take a few steps back and work out the detail of what the list should be with (say) 3 or 4 entries, on paper, keeping track of what would happen to the content of “1re” and “name3” as you go through a few iterations of the loop. Then revise your logic accordingly.

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [January 11, 2020, 6:00pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/3 "2020-01-11T18:00:02Z")

</div>

![스크린샷 2020-01-12 오전 2.48.38](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/3/73a955512ed2eecc970b5fd621f97183519fc309.png)  
Isn’t it logical to do it like a picture?  
This is not what I want.  
So how do I get the results I want?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 11, 2020, 6:05pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/4 "2020-01-11T18:05:32Z")

</div>

Are the items in var app Name3 all numbers? Are you trying to exclude any entry from before 1970?

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [January 11, 2020, 6:09pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/5 "2020-01-11T18:09:26Z")

</div>

name3 is a number in seconds. I want to save the time before the current time to 1re and remove it from name3.  
1re stores the value I want well.  
It should not be deleted from name3.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 11, 2020, 6:19pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/6 "2020-01-11T18:19:16Z")

</div>

You don’t want to remove #j, you want to remove item j. You want to first find the item you don’t want and figure out its index (position in the list). Then you can remove it once you know which # it is in the list. Is it first, second, third, etc.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 11, 2020, 6:28pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/7 "2020-01-11T18:28:39Z")

</div>

check this out.

these blocks do what you want.

 ![Screen Shot 2020-01-11 at 1.17.16 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/5/35973151b0272d067a3548889584ac87e4d15203.png)

you can play with my example here  
[https://x.thunkable.com/copy/122ff1edd2080e7973f492f2ededc480](https://x.thunkable.com/copy/122ff1edd2080e7973f492f2ededc480)

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [January 11, 2020, 6:29pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/8 "2020-01-11T18:29:05Z")

</div>

Aha!  
When I try to remove it, is it an index removal?  
I’m not trying to remove the index number.  
I want to remove j items.  
For example, 1528000 is the time.  
I want to delete this 1528000 time.  
I don’t know the index number of this.  
Is there a way to delete by item name time?

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [January 11, 2020, 6:30pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/9 "2020-01-11T18:30:31Z")

</div>

this code accomplishes that task

 ![Screen Shot 2020-01-11 at 1.19.54 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/4/8435c626c39ec148e079b7ca428472b9202ca434.png)

---

<div class="post-metadata">

**Author:** ![mom7667yafy](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@mom7667yafy](https://community.thunkable.com/u/mom7667yafy)\
**Post date:** [January 11, 2020, 6:54pm UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/10 "2020-01-11T18:54:36Z")

</div>

![스크린샷 2020-01-12 오전 3.42.43](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/d/4d7d243aa1a08a2318586cc0376e15d2eaed450a.png)

 ![IMG_EE5E946E9D20-1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/8/58f8abf9935070db0a30a7d2d9a0c83f51387093.jpeg)  
Thank you.  
Succeeded.  
But in my complicated app, it still doesn’t work as I want.  
Anyway, the basics made sense.

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [May 8, 2020, 8:36am UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/11 "2020-05-08T08:36:54Z")

</div>

@mom7667yafy - were you able to get this app working the way you wanted it to?

---

<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:29am UTC](https://community.thunkable.com/t/solved-how-can-i-delete-only-the-items-in-a-specific-list-from-a-list/402473/12 "2024-11-08T11:29:22Z")

</div>


