Select

Flow control Pure Generic
Select
Index 0
Result

Description

Returns one of N option values based on a zero-based index. Pure function — only the option the index picks is evaluated; the others are never run, so an option may safely read data that is only valid when it is the one selected. Fails the pipeline if the index is out of range.

When to use

Use Select when you have a small fixed set of candidate values and want to pick one by numeric index — for example, indexing into an enum-like list of strings or constants. Only the option the index picks is evaluated — the chain behind an unselected pin is never pulled — so an option may safely read data that is only valid when it is the one selected, and an expensive computation on an option costs nothing on the runs that do not choose it. For runtime branching of execution (not just values), use Branch or Switch instead.

Pins

Input pins

Pin Type Default Notes
Index integer 0 Zero-based position picking which option pin to return.

Output pins

Pin Type Notes
Result generic The value of the option pin at the given index.

Example

Translate a weekday number (0–6) into a string label. Configure the Select node with seven string option pins (“Sun” through “Sat”), then wire the day-of-week index into the Index input. The Result output carries the matching label and can be wired into the Message input of Log message.

See also