Adjusting list - part 2

Hi all,

I have a couple of lists, which I wanna combine.

The 5 lists needs to be combined to one list (showed in the code block). The “false” values need to be ignored.
Some extra difficulty… when there are more items besides false, then the prefab/ihwg needs to be ignored and the other value needs to be used.
Normally there will only be 1 other value besides the “false” in one row, but the possibility excists that there will also be an extra value (“ihwg” or “prefab”).

Hope I made myself clear.

List.Create > List.Transpose > List FilterByBoolMask for != “false” (keep the other values > List.FirstItem

It may be faster to use a nested if statement rather than create multiple lists via string replacement though. From the original searched string build a single design script statement in a code block like this:
init == “Value1”? “Value1Result” : init == “Value2” ? “Value2Result” : init == “Value3” ? “Value3Result” : init == “Value4” ? “Value4Result” : “ValueIfNoMatch” ;

How are you determining which value to use when there are multiple strings accepted? Is it just the first one found? I agree with @JacobSmall, it should be much faster to use a nested If statement to get the exact string needed for each value.

1 Like