How to get an item with a specific value from a list

Hello,

I want to get all items in the list with z=3000. Is there a way of doing this?

Thank you in advance.

@benameram
You can use the String.Contains node followed by a filtering by boolean.

1 Like

Hi @stefan.pandaciuc

Thank you for getting back to me. I have tried your suggestion but I am getting an error as seen below. it looks like the node doesn’t like the input.

Try to place String.FromObject before String.Contains
It may work

Hi @stefan.pandaciuc

Thank you so much for your help. the code worked but when I insert it into the next node I get this error. it looks like it doesn’t like the input as a string, even though it’s not. I got the same items of z=3000 with a manual method and it works.

Into the filter by bool mask, at the list, connect with the node that goes in string.fromobject.
This way you filter in/out the actual list, based on the string.

1 Like

Thank you @stefan.pandaciuc. It worked.

You can also try with List.AllIndicesOf to get all the indices of 3000, then GetItemAtIndex to get them

1 Like