The green groups are what I’ve expected when I use IF
When I start using lists, for true or false, I aways get a list with 1 or more items. It doesnt matter if the statement is true or false. See the pink groups.
In the ‘true with list’ example i’d expect to get ‘5’ as result. Not 5 and 5 in a list.
Why is this happening and how to solve to get my expected result?
ScopeIf is mainly used for custom nodes. It actually prevents the unused output from running so it only works in completely linear graphs. The problem (if you hadn’t noticed) is mismatched list lengths.
A codeblock is generally the best way to go:
i = test?0:1;
{true_opt,false_opt}[i];
This uses indices to pull the correct output which allows you to ignore any list structure issues.