> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# Switch

- Component: `appmixer.utils.controls.Switch5`
- Kind: Action
- Version: 1.1.0
- Visibility: Public
- Connector: [appmixer.utils.controls 1.14.7](https://connectors.appmixer.com/connector/appmixer.utils.controls/1.14.7.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.utils.controls/1.14.7/component/appmixer.utils.controls.Switch5>

Switch component with 5 configurable outputs (out1 - out5) and one default output (else). The default output `else` is used when the conditions for ports `out1 - out5` are not met or are not defined.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Output 1 (`expression1`) | expression | - |
| Output 2 (`expression2`) | expression | - |
| Output 3 (`expression3`) | expression | - |
| Output 4 (`expression4`) | expression | - |
| Output 5 (`expression5`) | expression | - |

## Output ports

### Port `out1`

_No fields defined for this port._

### Port `out2`

_No fields defined for this port._

### Port `out3`

_No fields defined for this port._

### Port `out4`

_No fields defined for this port._

### Port `out5`

_No fields defined for this port._

### Port `else`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.utils.controls.Switch5",
  "author": "Martin Krčmář <martin@client.io>",
  "label": "Switch",
  "description": "Switch component with 5 configurable outputs (out1 - out5) and one default output (else). The default output <code>else</code> is used when the conditions for ports <code>out1 - out5</code> are not met or are not defined.",
  "version": "1.1.0",
  "inPorts": [
    {
      "name": "in",
      "inspector": {
        "inputs": {
          "expression1": {
            "type": "expression",
            "label": "Output 1",
            "index": 1,
            "levels": [
              "AND",
              "OR"
            ],
            "fields": {
              "input": {
                "type": "text",
                "label": "Input",
                "index": 1
              },
              "operator": {
                "type": "select",
                "variables": false,
                "label": "Operator",
                "index": 2,
                "options": [
                  {
                    "label": "=",
                    "value": "="
                  },
                  {
                    "label": "!=",
                    "value": "!="
                  },
                  {
                    "label": ">",
                    "value": ">"
                  },
                  {
                    "label": ">=",
                    "value": ">="
                  },
                  {
                    "label": "<",
                    "value": "<"
                  },
                  {
                    "label": "<=",
                    "value": "<="
                  },
                  {
                    "label": "%",
                    "value": "%"
                  },
                  {
                    "label": "Empty",
                    "value": "empty"
                  },
                  {
                    "label": "Not empty",
                    "value": "notEmpty"
                  },
                  {
                    "label": "Contains",
                    "value": "contains"
                  },
                  {
                    "label": "Range",
                    "value": "range"
                  },
                  {
                    "label": "Regex",
                    "value": "regex"
                  }
                ]
              },
              "value": {
                "type": "text",
                "label": "Value",
                "when": {
                  "or": [
                    {
                      "eq": {
                        "./operator": "="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "!="
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">"
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "%"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "contains"
                      }
                    }
                  ]
                },
                "index": 3
              },
              "divisor": {
                "type": "number",
                "label": "Divisor",
                "index": 3,
                "tooltip": "Any number. If the <i>Divisor</i> divides the data under <i>Data</i> with reminder of 0, the filter passes through <code>true</code>. Otherwise, it passes through <code>false</code>.",
                "when": {
                  "eq": {
                    "./operator": "%"
                  }
                }
              },
              "rangeMin": {
                "type": "text",
                "label": "Minimum value",
                "index": 3,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "rangeMax": {
                "type": "text",
                "label": "Maximum value",
                "index": 4,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMin": {
                "type": "toggle",
                "label": "Exclusive minimum",
                "index": 3,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the minimum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMax": {
                "type": "toggle",
                "label": "Exclusive maximum",
                "index": 5,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the maximum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "regex": {
                "type": "text",
                "label": "Expected value",
                "tooltip": "Enter regular expression.",
                "when": {
                  "eq": {
                    "./operator": "regex"
                  }
                },
                "index": 3
              }
            }
          },
          "expression2": {
            "type": "expression",
            "label": "Output 2",
            "index": 2,
            "levels": [
              "AND",
              "OR"
            ],
            "fields": {
              "input": {
                "type": "text",
                "label": "Input",
                "index": 1
              },
              "operator": {
                "type": "select",
                "variables": false,
                "label": "Operator",
                "index": 2,
                "options": [
                  {
                    "label": "=",
                    "value": "="
                  },
                  {
                    "label": "!=",
                    "value": "!="
                  },
                  {
                    "label": ">",
                    "value": ">"
                  },
                  {
                    "label": ">=",
                    "value": ">="
                  },
                  {
                    "label": "<",
                    "value": "<"
                  },
                  {
                    "label": "<=",
                    "value": "<="
                  },
                  {
                    "label": "%",
                    "value": "%"
                  },
                  {
                    "label": "Empty",
                    "value": "empty"
                  },
                  {
                    "label": "Not empty",
                    "value": "notEmpty"
                  },
                  {
                    "label": "Contains",
                    "value": "contains"
                  },
                  {
                    "label": "Range",
                    "value": "range"
                  },
                  {
                    "label": "Regex",
                    "value": "regex"
                  }
                ]
              },
              "value": {
                "type": "text",
                "label": "Value",
                "when": {
                  "or": [
                    {
                      "eq": {
                        "./operator": "="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "!="
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">"
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "%"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "contains"
                      }
                    }
                  ]
                },
                "index": 3
              },
              "divisor": {
                "type": "number",
                "label": "Divisor",
                "index": 3,
                "tooltip": "Any number. If the <i>Divisor</i> divides the data under <i>Data</i> with reminder of 0, the filter passes through <code>true</code>. Otherwise, it passes through <code>false</code>.",
                "when": {
                  "eq": {
                    "./operator": "%"
                  }
                }
              },
              "rangeMin": {
                "type": "text",
                "label": "Minimum value",
                "index": 3,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "rangeMax": {
                "type": "text",
                "label": "Maximum value",
                "index": 4,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMin": {
                "type": "toggle",
                "label": "Exclusive minimum",
                "index": 3,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the minimum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMax": {
                "type": "toggle",
                "label": "Exclusive maximum",
                "index": 5,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the maximum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "regex": {
                "type": "text",
                "label": "Expected value",
                "tooltip": "Enter regular expression.",
                "when": {
                  "eq": {
                    "./operator": "regex"
                  }
                },
                "index": 3
              }
            }
          },
          "expression3": {
            "type": "expression",
            "label": "Output 3",
            "index": 3,
            "levels": [
              "AND",
              "OR"
            ],
            "fields": {
              "input": {
                "type": "text",
                "label": "Input",
                "index": 1
              },
              "operator": {
                "type": "select",
                "variables": false,
                "label": "Operator",
                "index": 2,
                "options": [
                  {
                    "label": "=",
                    "value": "="
                  },
                  {
                    "label": "!=",
                    "value": "!="
                  },
                  {
                    "label": ">",
                    "value": ">"
                  },
                  {
                    "label": ">=",
                    "value": ">="
                  },
                  {
                    "label": "<",
                    "value": "<"
                  },
                  {
                    "label": "<=",
                    "value": "<="
                  },
                  {
                    "label": "%",
                    "value": "%"
                  },
                  {
                    "label": "Empty",
                    "value": "empty"
                  },
                  {
                    "label": "Not empty",
                    "value": "notEmpty"
                  },
                  {
                    "label": "Contains",
                    "value": "contains"
                  },
                  {
                    "label": "Range",
                    "value": "range"
                  },
                  {
                    "label": "Regex",
                    "value": "regex"
                  }
                ]
              },
              "value": {
                "type": "text",
                "label": "Value",
                "when": {
                  "or": [
                    {
                      "eq": {
                        "./operator": "="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "!="
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">"
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "%"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "contains"
                      }
                    }
                  ]
                },
                "index": 3
              },
              "divisor": {
                "type": "number",
                "label": "Divisor",
                "index": 3,
                "tooltip": "Any number. If the <i>Divisor</i> divides the data under <i>Data</i> with reminder of 0, the filter passes through <code>true</code>. Otherwise, it passes through <code>false</code>.",
                "when": {
                  "eq": {
                    "./operator": "%"
                  }
                }
              },
              "rangeMin": {
                "type": "text",
                "label": "Minimum value",
                "index": 3,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "rangeMax": {
                "type": "text",
                "label": "Maximum value",
                "index": 4,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMin": {
                "type": "toggle",
                "label": "Exclusive minimum",
                "index": 3,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the minimum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMax": {
                "type": "toggle",
                "label": "Exclusive maximum",
                "index": 5,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the maximum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "regex": {
                "type": "text",
                "label": "Expected value",
                "tooltip": "Enter regular expression.",
                "when": {
                  "eq": {
                    "./operator": "regex"
                  }
                },
                "index": 3
              }
            }
          },
          "expression4": {
            "type": "expression",
            "label": "Output 4",
            "index": 4,
            "levels": [
              "AND",
              "OR"
            ],
            "fields": {
              "input": {
                "type": "text",
                "label": "Input",
                "index": 1
              },
              "operator": {
                "type": "select",
                "variables": false,
                "label": "Operator",
                "index": 2,
                "options": [
                  {
                    "label": "=",
                    "value": "="
                  },
                  {
                    "label": "!=",
                    "value": "!="
                  },
                  {
                    "label": ">",
                    "value": ">"
                  },
                  {
                    "label": ">=",
                    "value": ">="
                  },
                  {
                    "label": "<",
                    "value": "<"
                  },
                  {
                    "label": "<=",
                    "value": "<="
                  },
                  {
                    "label": "%",
                    "value": "%"
                  },
                  {
                    "label": "Empty",
                    "value": "empty"
                  },
                  {
                    "label": "Not empty",
                    "value": "notEmpty"
                  },
                  {
                    "label": "Contains",
                    "value": "contains"
                  },
                  {
                    "label": "Range",
                    "value": "range"
                  },
                  {
                    "label": "Regex",
                    "value": "regex"
                  }
                ]
              },
              "value": {
                "type": "text",
                "label": "Value",
                "when": {
                  "or": [
                    {
                      "eq": {
                        "./operator": "="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "!="
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">"
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "%"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "contains"
                      }
                    }
                  ]
                },
                "index": 3
              },
              "divisor": {
                "type": "number",
                "label": "Divisor",
                "index": 3,
                "tooltip": "Any number. If the <i>Divisor</i> divides the data under <i>Data</i> with reminder of 0, the filter passes through <code>true</code>. Otherwise, it passes through <code>false</code>.",
                "when": {
                  "eq": {
                    "./operator": "%"
                  }
                }
              },
              "rangeMin": {
                "type": "text",
                "label": "Minimum value",
                "index": 3,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "rangeMax": {
                "type": "text",
                "label": "Maximum value",
                "index": 4,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMin": {
                "type": "toggle",
                "label": "Exclusive minimum",
                "index": 3,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the minimum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMax": {
                "type": "toggle",
                "label": "Exclusive maximum",
                "index": 5,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the maximum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "regex": {
                "type": "text",
                "label": "Expected value",
                "tooltip": "Enter regular expression.",
                "when": {
                  "eq": {
                    "./operator": "regex"
                  }
                },
                "index": 3
              }
            }
          },
          "expression5": {
            "type": "expression",
            "label": "Output 5",
            "index": 5,
            "levels": [
              "AND",
              "OR"
            ],
            "fields": {
              "input": {
                "type": "text",
                "label": "Input",
                "index": 1
              },
              "operator": {
                "type": "select",
                "variables": false,
                "label": "Operator",
                "index": 2,
                "options": [
                  {
                    "label": "=",
                    "value": "="
                  },
                  {
                    "label": "!=",
                    "value": "!="
                  },
                  {
                    "label": ">",
                    "value": ">"
                  },
                  {
                    "label": ">=",
                    "value": ">="
                  },
                  {
                    "label": "<",
                    "value": "<"
                  },
                  {
                    "label": "<=",
                    "value": "<="
                  },
                  {
                    "label": "%",
                    "value": "%"
                  },
                  {
                    "label": "Empty",
                    "value": "empty"
                  },
                  {
                    "label": "Not empty",
                    "value": "notEmpty"
                  },
                  {
                    "label": "Contains",
                    "value": "contains"
                  },
                  {
                    "label": "Range",
                    "value": "range"
                  },
                  {
                    "label": "Regex",
                    "value": "regex"
                  }
                ]
              },
              "value": {
                "type": "text",
                "label": "Value",
                "when": {
                  "or": [
                    {
                      "eq": {
                        "./operator": "="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "!="
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">"
                      }
                    },
                    {
                      "eq": {
                        "./operator": ">="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "<="
                      }
                    },
                    {
                      "eq": {
                        "./operator": "%"
                      }
                    },
                    {
                      "eq": {
                        "./operator": "contains"
                      }
                    }
                  ]
                },
                "index": 3
              },
              "divisor": {
                "type": "number",
                "label": "Divisor",
                "index": 3,
                "tooltip": "Any number. If the <i>Divisor</i> divides the data under <i>Data</i> with reminder of 0, the filter passes through <code>true</code>. Otherwise, it passes through <code>false</code>.",
                "when": {
                  "eq": {
                    "./operator": "%"
                  }
                }
              },
              "rangeMin": {
                "type": "text",
                "label": "Minimum value",
                "index": 3,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "rangeMax": {
                "type": "text",
                "label": "Maximum value",
                "index": 4,
                "tooltip": "Any number or date (e.g. 2017-04-23 22:45). If the value under <i>Data</i> falls into the interval specified, the filter passes the message through. Otherwise, it ignores the message.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMin": {
                "type": "toggle",
                "label": "Exclusive minimum",
                "index": 3,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the minimum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "exclusiveMax": {
                "type": "toggle",
                "label": "Exclusive maximum",
                "index": 5,
                "tooltip": "Turn exclusivity on if you want to exclude test on equality for the maximum value.",
                "when": {
                  "eq": {
                    "./operator": "range"
                  }
                }
              },
              "regex": {
                "type": "text",
                "label": "Expected value",
                "tooltip": "Enter regular expression.",
                "when": {
                  "eq": {
                    "./operator": "regex"
                  }
                },
                "index": 3
              }
            }
          }
        }
      }
    }
  ],
  "outPorts": [
    "out1",
    "out2",
    "out3",
    "out4",
    "out5",
    "else"
  ],
  "icon": "(data URI omitted)"
}
```
