switch

This block is part of the object group and was last modified in core v12.0.4.

switch v12.0.4

Returns a object based of the given expression.

In pins 2
  • expression required
    value

    The expression to evaluate.

  • default
    object

    The default statement to be executed.

Out pins 2
  • output
    object

    Returns the object matching the expression.

  • match
    condition

    Returns true in case a match was found.

Data selector: stringifies the expression value and compares it for exact STRING equality against each case pin's label; outputs the matching case's object with matched=true, else the default input with matched=FALSE (default never counts as a match). No match and no default yields object=nil. Only the winning input's pure-data chain is evaluated.

A typical wiring for switch: the object out pin feeds custom field.

Studio canvas example for the switch block: typical wiring for switch.

Version history

Introduced in v12.0.4.


Back to object Return to the main group to view all sub-groups Back to object Return to the group to view all blocks within this group