# Condition

Conditions in CollectAction offers a very flexible and wide filtering feature. It allows you to define very simple filters as well as complex nested filters.

**A simple example** : Let the people who visit the product page see the action.

**A complex example :** Users coming from Istanbul or Ankara between 20-22 hours should see the winter campaign action if the weather will drop below zero in the next 3 days.

We can divide the filters in the Conditions section into 3 main parts. These are grouped in Who, Where and When sections respectively. You can find more detailed information about the filters in these groups in the relevant sections of the document.

{% hint style="info" %}
Who, Where, When are connected to each other with **And**.
{% endhint %}

&#x20;If we evaluate a line in the Conditions section by itself, you can select a comparison suitable for the filter type you have selected and enter the values you want to be realized.

![Who Example](/files/IiE6sZDskpQz0PLaQ0Me)

### 1 - Filter Type

&#x20;The leading part of each filter row indicates the type of that filter. There may be sub-branches prepared and branched according to this type. These have at least 1 comparison and 1 expected value part. When a filter type is defined, the system captures the actual value of that type and considers it to have passed the filter if it passes the comparison of the value with the predefined expected value according to the selection in the comparison section. To put it more simply using the example above, with this filter, the system allows the action to run if the type of a user (Filter Type) becomes a new user (Expected value) (Comparison).

You can find more detailed information about User Type in the [Who Parameters](/collectaction-app-store/filter-settings/condition/who-parameters.md) section.&#x20;

### 2 - Comparison&#x20;

&#x20;It is the part that specifies how the expected value part and the actual value captured with the filter type will be compared to each other in the comparison part. There is at least one comparison in each filter line. Comparison types in general;

* Boolean
* Text
* Numerical
* Temporal

![A comparison of type Boolean](/files/tDkx6IIFatiXnjD3g20v)

![A comparison in text type](/files/uf5JsXNoMEnpwKUl5PCE)

![A comparison of type Numeric](/files/z2gdkezWKzvKeMDcfxv8)

![A comparison of temporal type](/files/3QOIucFeKEjFA7a5aOuW)

### 3 - Expected Value

The value checked in the filter is the value expected to be realized.

### 4 - Cancel Button

Allows you to remove the filter row

### 5 - Or Conjunction

&#x20;You can link multiple rows of a filter type together with the Or connector (number 5) to ensure that it works when any one of them is successfully executed.

### 6 - And Conjunction

&#x20;You can connect multiple filters together with the And conjunction (number 6) to define that they must all occur successfully.

Conditions can be added in many ways from a filter line as above. Depending on how comprehensive or limited filtering you want to do, you can adjust your arrangements here.

In the CollectAction Conditions section, some filter rows may be locked and/or unchangeable. This is because these filter lines are required by the system for that action to work. It is defined by the system not to interfere with these filters.

![In the Free Shipping campaign on the Cart Page, the Page Type filter is fixed as Cart Page.](/files/IN9nTOv296Fm0KuNBiYF)

{% hint style="danger" %}
The filter types All Users, Every Page, All the Time in the Who, Where, When sections are ineffective. They have no effect on filtering.
{% endhint %}

**All Users:** Includes All Users and this action works for all users.

**Every Page:** Includes all pages and this action works for all pages.

**All The Time:** It includes all times and this action works for all times.

![Who - All Users : All Users&#x20;
Where - Every Page : On all pages&#x20;
When - All the Time : All the Time](/files/ZPlR9mrB5IZZgEbQdoht)

### Examples;

![If a user; (Who) is a new user and (Where) is on the home page and (When) is on Saturday or Sunday, the campaign will be shown. Example usage : Show a campaign card on the homepage to new users on the weekend](/files/eVfsmnWXLszmGRn401AG)

![A user; (Who) If there are at least 2 products in the cart and the amount of the cart is at least 200 and (Where) On the cart page, the campaign will be shown.&#x20;
Example Usage : To show the free shipping campaign to people with more than a certain amount in their cart on the cart page.](/files/qaPUY1vqZcreXqBiRThe)

![A user; (Who) is a person whose weather forecast is below zero within 3 days, and (Where) lives in Istanbul or Ankara, and (Where) is on the homepage, and (When) is before 15:00, the campaign will be shown.
](/files/xj7m73nTCgC7ZrHBIrs4)


---

# 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://yapaytech.gitbook.io/collectaction-app-store/filter-settings/condition.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.
