How to conditionally format a list

I have two Lists and i wish to create a third

The first list is composed of 50 elements. This elements are integers varying from 1 to 7
The second list is composed of 7 elements.
The third list is composed of the same amount of elements of the first list but it follows the following pattern:
If index 0 of list 1 is equal to 1 than index 0 of list 3 is equal to index 0 of list 2.
If index 0 of list 1 is equal to 2 than index 0 of list 3 is equal to index 1 of list 2.
.
.
.
If index 0 of list 1 is equal to 7 than index 0 of list 3 is equal to index 6 of list 2.

This criteria would be applied for all elements in list 1.

Thank you all in advance

If I’ve understood you correctly, then this is one way of achieving what you want.

1 Like

You understood what i mean and that will solve my problem. However, i need to know how to build that code block with ind ind -1.

Thanks !

Ok, just doubleclick anywhere in the canvas and you’ll open a Code Block! :slight_smile:

1 Like

I keep getting this error message

Oh… I’ve seen my mistake. The “/” code block should be connected to the list input of the List.GetItemAtIndex and the Code Block should be connected to the index input of the List.GetItemAtIndex Code Block. I did it at the contrary.

Thank you for your help!

Another way…

2 Likes