Skip to main content
Routes the test value into one of several branches based on a check, with an optional fallback for “none of the above”. Per dated property in the test value, Switch picks the first branch whose check conforms with the value, or falls through to the fallback. Pair with Each when downstream branches should iterate inside a list.

Inputs

  • Test Value — the dated property (or list of them) to route.

Outputs

  • Check — connect one or more nodes whose result decides the branch. The matched branch always carries the original test value onward (with its valid_from intact), not the check node’s own output.
  • Fallback (optional) — taken when no Check conforms. If a value matches no Check and no Fallback is wired, evaluation fails — a value with nowhere to go is a misconfiguration, not a silent drop.
  • Empty — taken when the test input is an empty timeline. Wire a subgraph here to emit a default value when the upstream has no data. If unwired, Switch emits an empty timeline directly.
  • Result — the merged result after routing every dated property.

How conformity is decided

  • Value nodes (Constant, Attribute, Date Today, arithmetic, …) conform when their output equals the test value.
  • Date range checks (a Constant typed date range, or a Date Range node) conform when the test value falls inside the period — bounds inclusive, an empty bound meaning open-ended. A range test value conforms when the two ranges overlap.
  • Predicate nodes (Equals, Match, Greater Than, Less Than, …) conform when their output is true.
  • An exact value match wins over a passing predicate. More than one match in the winning tier is nondeterministic and errors. A check whose subgraph errors simply doesn’t match.
Date-range checks count as value matches, so overlapping ranges on one Switch are an error rather than a first-one-wins race. Wire the catch-all to Fallback instead of adding a range that covers everything.

Ports