# Operators

Both [conditions](https://docs.appfarm.io/reference/platform-concepts/conditions) and [filters](https://docs.appfarm.io/reference/platform-concepts/filters) use operators to compare data. Appfarm supports many different operators depending on the data type of the values you are comparing.

You can use [comparison operators](#comparison-operators) to check for equality or difference between two values. [Logical operators](#logical-operators) check for the presence or absence of a value. To search for the presence of text in a value, [string operators](#advanced-string-operators) are available.&#x20;

As an example, if you were to filter a data source on all active Projects, you would construct the filter  `Projects.Status EQUALS Active`. `EQUALS` is the *operator***,** `Projects.State` is the *left operand* and `Active` is the *right operand*.

## Comparison operators

<table><thead><tr><th width="161">Operator</th><th>Description</th></tr></thead><tbody><tr><td><strong>Equals</strong></td><td>Check if two values match. Both values must be of the same data type.</td></tr><tr><td><strong>Not equals</strong></td><td>Check if two values do not match. Both values must be of the same data type.</td></tr><tr><td><strong>&#x3C;</strong></td><td><em>Available for Integer, Float, and Datetime data types.</em><br>Check if a value is less than another.</td></tr><tr><td><strong>&#x3C;=</strong></td><td><em>Available for Integer, Float, and Datetime data types.</em><br>Check if a value is less than or equal to another.</td></tr><tr><td><strong>></strong></td><td><em>Available for Integer, Float, and Datetime data types.</em><br>Check if a value is greater than another.</td></tr><tr><td><strong>>=</strong></td><td><em>Available for Integer, Float, and Datetime data types.</em><br>Check if a value is less than or equal to another.</td></tr></tbody></table>

{% hint style="danger" %}
**Warning**

Properties with a Boolean data type can be *undefined* which is neither true nor false. Typically you should use `Not equals true` when comparing boolean values instead of `Equals false` to ensure you capture these values.
{% endhint %}

## Logical operators

<table><thead><tr><th width="162">Operator</th><th>Description</th></tr></thead><tbody><tr><td><strong>Is any of</strong></td><td>Check for the presence of a value in another data source or static value. Both values must be of the same data type. It can also be used to check against <a href="../data-model/enumerated-types">enum values</a>, for example <code>Project.Status IS ANY OF New, Started</code>.</td></tr><tr><td><strong>Is none of</strong></td><td>Check for the absence of a value in another data source or static value. Both values must be of the same data type. It can also be used to check against <a href="../data-model/enumerated-types">enum values</a>, for example <code>Project.Status IS NONE OF Completed, Archived</code>.</td></tr><tr><td><strong>Exists in</strong></td><td><em>Available for Reference data type.</em><br>Check for the presence of an object in another data source. The data source can be restricted to selected objects, not selected objects, or a filtered selection.</td></tr><tr><td><strong>Not exists in</strong></td><td><em>Available for Reference data type.</em><br>Check for the absence of an object in another data source. The data source can be restricted to selected objects, not selected objects, or a filtered selection.</td></tr><tr><td><strong>Has all of</strong></td><td><em>Available for Reference data type with</em> <a href="../../data-model/object-class-properties#general-properties"><em>cardinality Many</em></a><em>.</em><br>Check if <em>all</em> of the IDs of the left operand are present in the data source of the right operand. In this case, the left operand is a multi-reference property, containing a list of IDs (references).</td></tr><tr><td><strong>Has some of</strong></td><td><em>Available for Reference data type with</em> <a href="../../data-model/object-class-properties#general-properties"><em>cardinality Many</em></a><em>.</em><br>Check if <em>some</em> of the IDs of the left operand are present in the data source of the right operand. In this case, the left operand is a multi-reference property, containing a list of IDs (references).</td></tr><tr><td><strong>Has none of</strong></td><td><em>Available for Reference data type with</em> <a href="../../data-model/object-class-properties#general-properties"><em>cardinality Many</em></a><em>.</em><br>Check if <em>none</em> of the IDs of the left operand are present in the data source of the right operand. In this case, the left operand is a multi-reference property, containing a list of IDs (references).</td></tr><tr><td><strong>Has value</strong></td><td>Check for the presence of a value, and that the property is not empty or set to <em>null</em>.</td></tr><tr><td><strong>Has no value</strong></td><td>Check for the absence of a value, such as when the property is empty or set to <em>null</em>.</td></tr></tbody></table>

## String operators

When the left operand has a data type of String, the string operators are made available, and you can compare the value against another string. Note that these operators are *not* available when constructing filters in data sources. They are only available when constructing client-side conditions and filters in the [UI](https://docs.appfarm.io/reference/apps/ui) or [actions](https://docs.appfarm.io/reference/apps/actions).

All string operators are case insensitive.

{% hint style="info" %}
**Example**

To help describe how these operators work, we'll use the example of a data source filter. The data source has a property *name* (left operand), and we want to compare the value of that property with the text *big blue button* (right operand). The Results column in the table below describes what would be returned from the filter when using a given operator.
{% endhint %}

<table><thead><tr><th width="217.33333333333331">Operator</th><th>Results</th></tr></thead><tbody><tr><td><strong>Contains</strong></td><td>Objects whose name property contains the exact phrase <em>big blue button</em>.</td></tr><tr><td><strong>Contains all</strong></td><td>Objects whose name property contains all three words <em>big</em>,  <em>blue</em>, and <em>button</em>, including as part of larger words.</td></tr><tr><td><strong>Contains all words</strong></td><td>Objects whose name property contains all three standalone words <em>big</em>, <em>blue</em>, and <em>button</em>.</td></tr><tr><td><strong>Contains any</strong></td><td>Objects whose name property contains at least one of the three words <em>big</em>,  <em>blue</em>, or <em>button</em>, including as part of larger words.</td></tr><tr><td><strong>Not contains</strong></td><td>Objects whose name property does not contain the exact phrase <em>big blue button</em>.</td></tr><tr><td><strong>Not contains all</strong></td><td>Objects whose name property does not contain all three words <em>big</em>, <em>blue</em>, and <em>button</em>, including as part of larger words.</td></tr><tr><td><strong>Not contains all words</strong></td><td>Objects whose name property does not contain all three standalone words <em>big</em>, <em>blue</em>, and <em>button</em>.</td></tr><tr><td><strong>Not contains any</strong></td><td>Objects whose name property does not contain any of the three words <em>big</em>, <em>blue</em>, or <em>button</em>, including as part of larger words.</td></tr></tbody></table>
