---
title: Switch
slug: bhdo-v3/switch
createdAt: 2024-11-01T16:58:37.618Z
---

The **Switch** processor sends the content of incoming messages to an output only when rule checks are met.

# Switch Overview

- Available rules to be checked are:
  - **==** - Equals
    - For strings, **input value** and **checked value** need to be lexicographically equal.
  - **!=** - Not Equals
    - For strings, **input value** and **checked value** need to be lexicographically different.
  - **\<** - Less than
    - For strings, **input value** needs to be lexicographically before **checked value.**
  - **\<=** - Less than, or equals
    - For strings, **input the value needs to be lexicographically equal to or before the checked value.**
  - **>** - Greater than
    - For strings, **input value** needs to be lexicographically after **checked value.**
  - **>=** - Greater than or equals
    - For strings, **input value** needs to be lexicographically equal to or after **checked value.**
  - **is true** - Only applicable for fields having **Bool** data type
  - **is false** - Only applicable for fields having **Bool** data type
  - **is null** - Given field should not be present in the input
  - **is not null** - Given field should be present in the input
  - **is of type** - Compares the datatype of field with given
  - **contains** - Only applicable for fields having **String** or **JSON** data type
- For string datatype, the rules for comparison are done through *GoLang&#x20;***`strings.compare`**
- **Field Name**, **Check Value,** and **Check Value Type** Represent what field to look for, for the comparison, what value to check for, and what is the expected type for the mentioned value.
- **Output Name** is used to restrict/filter where to publish the output to.
  - If left empty, output will be published to all connected processors.

# Switch Parameters

| **Parameters**    | **Details**                                                                                                       |
| ----------------- | ----------------------------------------------------------------------------------------------------------------- |
| Rule              | The Rule specifies the condition to be checked (e.g., Equals or Not Equals).                                      |
| Field Name        | The Field Name indicates the specific field in the input message for comparison.                                  |
| Check Value       | The Check Value is the value against which the Field Name is evaluated.                                           |
| Check Value Type  | The Check Value Type defines the expected data type of the Check Value.                                           |
| Output (Optional) | The Output determines where the result will be published or if it goes to all connected processors if left empty. |

![](https://api.archbee.com/api/optimize/vAqK-046vdh4I0e1y9cfX/q_D70e-fl3xlp47uow48h_image.png)

