> 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).

# appmixer.utils.controls.Condition

- Component: `appmixer.utils.controls.Condition`
- Kind: Action
- Version: 1.0.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.Condition>

Evaluates expression(s) and sends data to true or false port.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Condition (`expression`) | expression | - |

## Output ports

### Port `true`

_No fields defined for this port._

### Port `false`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.utils.controls.Condition",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Evaluates expression(s) and sends data to true or false port.",
  "version": "1.0.0",
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "expression": {
            "type": "object",
            "properties": {
              "AND": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "OR": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "operator": {
                            "type": "string",
                            "enum": [
                              "=",
                              "!=",
                              ">",
                              ">=",
                              "<",
                              "<=",
                              "%",
                              "empty",
                              "notEmpty",
                              "contains",
                              "range",
                              "regex"
                            ]
                          }
                        },
                        "required": [
                          "operator"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "inspector": {
        "inputs": {
          "expression": {
            "type": "expression",
            "label": "Condition",
            "index": 1,
            "levels": [
              "AND",
              "OR"
            ],
            "fields": {
              "input": {
                "type": "text",
                "label": "Input",
                "index": 1
              },
              "operator": {
                "type": "select",
                "variables": false,
                "label": "Operator",
                "index": 2,
                "required": true,
                "when": {
                  "eq": {
                    "./OR": null
                  }
                },
                "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": [
    "true",
    "false"
  ],
  "icon": "(data URI omitted)"
}
```
