Matching Lists As Per Item Position

Hi all!

I’ve got a problem where I’m trying to match the list on the left to the same item positions on the right. This will be used for sub lists too (as you probably can see in the pic), which probably makes it more difficult?

I’ve tried to use List.Indexof to get the correct item positions but I don’t have a clue where to go from there. I don’t want to use custom nodes if it can be helped.

I’ve been on this problem for a week and I think I’m going crazy.



Hi @rxylab,
Welcome to the Dynamo community.

Something like this?

Also, it is always a good idea to share the image of the whole graph so others can know what the context is and help you accordingly .

1 Like

Hi Amol,

Thanks for the warm welcome.

The code block had worked! Please could you explaing what the code block does? My reading of code is poor.

I didn’t post the whole graph because it is quite large and didn’t know how to best show it. I can still do it if you require it?

Thanks so much for the help!

1 Like

That Code Block is essentially an if condition.
The format of an if condition in a Code Block is


You can get the same result with the OOTB nodes as follows:

I don’t require the graph now since it’s solved. It was just a suggestion!
This post shall help you with exporting the graph for any future posts.