Select boolean
Description
Returns one of two values based on a boolean condition. Generic on both branches, in shape as well as type: scalars, arrays, maps and whole model values can be connected as long as both branches agree, and the type is fixed at design-time when the first one is. Pure function — only the branch the condition picks is evaluated; the other is never run, so a branch may safely read data that is only valid on its own side of the condition.
When to use
Use Select boolean for inline ternary-style selection of a value — picking between two options based on a boolean condition without splitting the execution flow. Only the branch the condition picks is evaluated — the chain behind the other one is never pulled — so a branch may safely read data that is only valid on its own side of the condition, such as reading element 0 of an array the condition has just checked is not empty. It picks whole values as readily as scalars — an array, a map or a model value passes through untouched — so it can choose between two parsed payloads without breaking either one apart first. If you need to choose between two execution paths instead of two values, use Branch.
Pins
Input pins
| Pin | Type | Default | Notes |
|---|---|---|---|
| Condition | boolean | false | The boolean that picks which value to return. |
| When true | generic | — | The value returned when condition is true. The type resolves at design-time from the connected source, and fixes the type of the When false pin too — as does the shape, so an array branch needs an array on the other branch. |
| When false | generic | — | The value returned when condition is false. It takes the same type and shape the other branch resolved to. Left unconnected on an array or map pin it falls back to an empty collection. |
Output pins
| Pin | Type | Notes |
|---|---|---|
| Result | generic | Either whenTrue or whenFalse, depending on condition. Both share the resolved generic type and shape. |
Example
Label a numeric score as “pass” or “fail” before logging. Wire the Result output of
Greater than? into the Condition input of Select boolean, set the When true input to
"pass" and the When false input to "fail". The Result output carries the matching
label and can be wired directly into the Message input of Log message.