Remove items from a list not based on their value

Hello,

Would love your help with a small issue.
I’m trying to create a list with items but remove some of the items, not depend on their value but depend on their order.
I want to remove all items from row X and above.

Does anyone know how to do it?

Thank you!

If you see in List section there’s a block called:

in list-remove-# it might help.

Otherwise also in List section you can create a sub-list of items and just work with it.
Don’t forget you can play with row’s lenght by using the block “list lenght”.

Hope it helped

if i want to delete multiple items at once?
3-14 what’s the smartest way?

Show me your blocks, there are several smart ways to do it, but it depends on your blocks

I tried something like that. but will do anything better :slight_smile:

1 Like

i would create a list of indexes to be removed.
reverse the list
then loop that list and remove the item at that index from highest to lowest. doign it this way will retain the original index for each list item. to make it more understandable look at this list.

1,2,3,4,5,6,7

if i remove items 2-4 in a loop in order,

on loop 1, when removing item at index 2 im left with
1,3,4,5,6,7

on loop 2 whhen removing item at index 3, im left with
1,3,5,6,7

on loop 3 when removing item at index 4 im left wiith
1,2,5,7

when removin them in reverse order, i get

1,2,3,4,5,6,7

1,2,3,5,6,7
1,2,5,6,7
1,5,6,7

3 Likes

It’s working! thank you so much!

1 Like