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

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.

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.

1 Like


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?

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

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.

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.

check this out.

these blocks do what you want.

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

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?

this code accomplishes that task

1 Like


Thank you.
Succeeded.
But in my complicated app, it still doesn’t work as I want.
Anyway, the basics made sense.

1 Like

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