Compare 2 lists element by element and return index

Hey guys,

I want to compare each element of one list (list A) to all elements of a second list (list B). and return the index of the matching in list B

example: (not a correct code of course)

for a in listA
{
for b in listB
{
if (a = b ) return index of b
}
}

I’ve tried to use " indexof " node but it doesnt work

Any help is much appreciated.

Thank you.

You could try the node List.AllIndicesOf:

Hi, you could use “Equal x to y?” to compare the 2 lists, and potentially “Filter by boolean mask” if relevant:

… and if it doesn’t work, you can also try this node from Bakery:

Thanks a lot, it worked perfectly :smiley:

the X=Y didnt work, i will try the Bakery node, Thanks a lot :smiley: