List Combining depending on Null

I thought I could get to the bottom of this one, but it seems my Dynamo knowledge is lacking.

I’m attempting to replace all duplicated material assets with the original asset.
In order to do this, I’m collecting all asset names, looking for ones with a () suffix and checking is there is an original without a suffix still in the model.

In essence, from the image below, I am looking at List C; at every index of a null, I want to use the value from List A instead, as these are the assets where the original has been purged out or similar.

How can I create such a list?
I’ve tried playing with the ReplaceItemAtIndex and ReplaceByCondition nodes but I’m not getting what I’m after.

Note that this extract of the script is only concerning itself with (1) suffixes, I’ll cross the bridge of wildcard suffixes later!

Try codeblock: c==null?a:b.

1 Like