switch

This block is part of the value group and was last modified in core v10.4.28.

switch v10.4.28

Returns a value based of the given expression.

In pins 2
  • expression required
    value

    The expression to evaluate.

  • default
    value

    The default statement to be executed.

Out pins 2
  • output
    value

    Returns the value matching the expression.

  • match
    condition

    Returns true in case a match was found.

String-compares the expression's value, EXACT and case-SENSITIVE, against each case pin's NAME and outputs the value wired into the matching case pin; when nothing matches it outputs the default pin's value. matched is true only for a non-default match; with no match and no default wired, value is nil and matched is false. There is no fall-through and no partial matching.

A typical wiring for switch: the value out pin feeds convert to uppercase.

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

Version history

Introduced in v10.4.28.


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