Padding a list to match another by inserting elements where needed

Hi all,
I would think this is a common task, but I cannot wrap my head around it right now.
I have a “master” list of elements and several smaller lists where some of the elements are removed.
These lists are obviously randomly shorter than the master list.
I need to pad these lists so that they are back to the full length, and where the element are missing should say something like “N/A”.
Any idea?

thank you

1 Like

@Giovanni_Succi ,

start with this… in my quick created lists i have also duplicates, i ignored it in this example… i think SetIntersection is the way

listIntersection.dyn (28.6 KB)



1 Like

c = List.Contains(a<1>, b<2><3>);
c<1> ? b : "N/A";

Nice, it works: simple and elegant.

Thank you Vikram.

Now I have to understand HOW it works… :frowning:


Thank you Andreas, but, you would agree, not as straightforward as the one design script node from Vikram.

1 Like