Select

Flow control Pure Generic
Select
Value
Result
Default

Description

Returns the case pin whose configured value matches the value input, or the Default pin when none does. Matching is the same as Switch: the value and each case are compared as text. Pure function — only the chosen pin is evaluated; the others are never run, so a case may safely read data that is only valid when it is the one selected. Fails the pipeline when no case matches and Default is not set; Default counts as set when it is wired or has a typed-in value. The value input is generic and locks to its connected type at design-time. In graph JSON, the case pins are configured in the node config: `cases` is a JSON array string such as [{"id":"sat","value":"SATURDAY"},{"id":"sun","value":"SUNDAY"}], and each entry gives a generic input pin named `case-<id>`. The first case with a matching value wins.

When to use

Use Select when you want to turn one value into another by lookup — a weekday into a number, a status into a label, an HTTP method into a path. Each case pin is configured with the value to match (a dropdown when the Value is an enum) and carries the value to return. Matching works like Switch: both sides are compared as text, and the first matching case wins. Only the chosen pin is evaluated — the chain behind every other case and behind Default is never pulled — so a case may safely read data that is only valid when it is the one chosen. A value that matches no case returns Default, or fails the pipeline when Default is not set. To pick by position instead of by value, use Select index; to branch execution by value, use Switch.

Pins

Input pins

Pin Type Default Notes
Value generic — The value to match against the cases. The type resolves to the connected source's type at design-time, independently of the case pins. It is compared as text, like Switch does.
Default generic — Returned when no case matches. It counts as set when it is wired or has a typed-in value, and is only evaluated when it is used. Leave it empty and a value that matches no case fails the pipeline. It takes the same type as the case pins.

Output pins

Pin Type Notes
Result generic The case pin whose value matches, or Default when none does. The case pins and Default share one type, fixed by the first one connected or by the input Result feeds.

Example

Count the days to skip when a date falls on a weekend. Wire the date into Break date and its Weekday output into the Value input of Select. Add two cases: SATURDAY returning 2 and SUNDAY returning 1, and type 0 into Default. Wire the Result into the Amount input of Add to date, with Unit Days and the same date in Value: a Saturday moves two days ahead and a Sunday one, landing on Monday, while every weekday moves by zero.

See also