Get index of list item when condition is met

Hi, I’m finding lots of nodes that are close, including List.AllIndicesOf, but not getting the results I’m after. I’m also newer to this forum so I apologize if this thread was already created.
I feed in the list and want to use a variable string for the search item. Then use the indices returned to grab values in another list. Is this the right approach?

Try using a number 1 instead of the string “1”.

1 Like

Hi Jacob, I tried that with a code block and still no luck. The examples I’ve seen all appear to place a boolean in the item portion but that doesn’t make sense to me if I’m searching for a particular value.

I also tried the Number node with value of 1.000 and still no luck.

I’m so close but have an issue with variable type. I found another custom node(not sure which package) that works if I used a 2; in code block, no quotes. But I need it to pull from my parameter value instead.listallindicesof2

Hi Jacob, just a follow-up that I was able to finally get it working by converting the string number to an integer. Thanks for pointing me in the right direction.

1 Like