Insert at index using conditional

Hello,

Can’t seem to find a way to add the string “Main Model” to every sublist that only contains one element.

Looking for an end list that whenever item at index 0 is “Main Model” it appends another one at index 1 at that same sub-list level.

All sub-lists will end having 2 items only.

Any ideas?
Thank you

Maybe this python script can help you!

2 Likes

thank you
but still not working… :frowning:

You have to use the python script after your “code block” node shown in your first screenshot :stuck_out_tongue:

1 Like

many thanks @tiagocorradi.

Works a treat :slight_smile:

Hi there,

I think you could do the same without using Python nodes:

Cheers

Manel

2 Likes

very slick, @Manel_Fernandez.

I like it!