Get item of nested sublists

Hi,

I think my problem is really simple but can’t figure out, I would like to take item of a @4 levels nested lists.
The goal is to keep list structure exactly the same but take only the “P01”.

thanks !

1 Like

You’d have to have nested GetItemAtIndex nodes. This is much simpler (and cleaner) using design script.
list[0][0][0] will get you the item at index 0 of sublist index 0 of list 0.

3 Likes

If you need only P01 use a code block, if you need P01, P02, P03… (so the first of every sublist) use levels of List.GetItemAtIndex:

2 Likes

Many thanks, I can extract the value, but I need to have the substructure intact.

list
  list
    list
      P01
      P02
      P03
      P04
    list
      P01
      P02
      P03
      P04

Like this.
However, neither level for GetItemAtIndex node or code block seems working…
(The P01 value is an example, I look like to the other values)

Doesn’t Keep list structure when using levels on List.GetItemAtIndex do what you want?

I find that ticking the box doesn’t take immediate effect when you rerun (or when Automatic is being used), you need to change the @level to a different value and then revert back again for it to take effect

3 Likes

Beautiful !
Was just in front of my face :dizzy_face:

Many thanks Thomas !

1 Like

Thanks for help !