# Conditions

When you using CDP 365, these conditions usually appear throughout system features

## Logical operator&#x20;

![](/files/NOi1SZCNM6WhDISISsyQ)

| Operator | Description                                                       |
| -------- | ----------------------------------------------------------------- |
| AND      | Data will be retrieved when all the matching conditions are met   |
| OR       | Data will be retrieved when one of the conditions combined is met |

> **Example**: Get a list of users who have phone numbers and email address information  &#x20;
>
> * **Combined with AND:** requires the user to have both phone numbers and email address, missing 1 of the 2 will not satisfy the condition
> * **Combined with OR**: user only has phone numbers or email address will satisfy the condition&#x20;

{% hint style="warning" %}
Note: **CDP 365** supports maximum&#x20;

* 20 OR conditions in each set
* 20 AND conditions in one OR condition
  {% endhint %}

## Comparison function&#x20;

![](/files/79YUReH1PbDm5Sh5Vln7)

| Function                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| equal to                 | Returns objects whose value is equal to the comparison value (case sensitive, signed, unsigned)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| not equal to             | Returns objects whose value is different from the comparison value (case sensitive, signed, unsigned)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| before date              | Returns objects whose data is retrieved before the selected date range                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| after date               | Returns objects whose data is retrieved after the selected date range                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| between                  | <p>Returns objects whose data is in the comparison date range<br><br>Example: Calculate</p><ul><li>Condition: <strong>between</strong> 02/02/2022 <strong>and</strong> 05/02/2022</li><li>Result: objects whose data is between 02/02/2022 and 02/05/2022</li></ul>                                                                                                                                                                                                                                                                                                                                                                                   |
| equal time ago           | <p></p><p>Returns objects whose data is retrieved in the range: from the selected day to the number of days/time before</p><p><br>Example: calculate on 05/02/2022</p><ul><li>Condition: <strong>equal time ago</strong> 2 days</li><li>Result: objects are between 03/02/2022 and 04/02/2022</li></ul><p>Example: calculate at 11:30 AM</p><ul><li>Condition: <strong>equal time ago</strong> 3 hours</li><li>Result: objects are between 8.30 AM and 10.30 AM</li></ul>                                                                                                                                                                             |
| not equal time ago       | Returns objects whose data is retrieved not in the range: from the selected day to the number of days/time before                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| before time ago          | <p>Returns objects with time values ​​that are days/hours back from the date of calculation<br></p><p>Example: perform calculation on 05/02/2022</p><ul><li>Condition: <strong>before time ago</strong> 2 days</li><li>Result: objects with a time value from February 3, 2022 or earlier</li></ul>                                                                                                                                                                                                                                                                                                                                                   |
| after time ago           | <p>Returns objects with a time value that is days/hours away from the time of calculation (to the time of calculation)</p><p></p><p>Example: perform calculation on 05/02/2022</p><ul><li>Condition: <strong>after time ago</strong> 2 days</li><li>Result: objects with a time value from February 3, 2022 to February 5, 2022 (calculation time)                                                                                                                                                                                                                                                                                         </li></ul> |
| exists                   | Returns objects that have the value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| not exist                | Returns objects that have no value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| match any of             | Returns objects whose value matches any value in the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| contains                 | Returns objects whose value contains the character string of the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| not contain              | Returns objects whose value does not contain the character string of the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| starts with              | <p>Returns objects whose values ​​start with the character string in the comparison condition</p><p><br>Example: get a list of phone numbers with the prefix 0916</p><ul><li>Condition: <strong>starts with</strong> 0916</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                   |
| not start with           | Returns objects whose value does not start with the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ends with                | <p>Returns objects whose value ends with the character string in the comparison condition<br><br>Example: get an email list whose email domain is @gmail.com</p><ul><li>Condition: <strong>ends with</strong> @gmail.com</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                    |
| not end with             | Returns objects whose value does not end with the character string in the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| greater than             | Returns objects whose value is greater than the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| greater than or equal to | Returns objects whose value is greater than or equal to the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| less than                | Returns objects whose value is less than the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| less than or equal to    | Returns objects whose value is less than or equal to the comparison condition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.antsomi.com/cdp-365-user-guide-en/annotation/conditions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
