# Conditions in Appverse

A **Conditional Block** is a logic-based structure used to execute specific actions or workflows only when predefined conditions are met. It enables dynamic decision-making by evaluating input values. In Appverse, a conditional block is used in the following features to control their executiion

* [Events and actions](https://viewzenlabsug.gitbook.io/userguides/appverse/apps/create-an-app/forms/events-and-actions)
* [Child forms](https://viewzenlabsug.gitbook.io/userguides/appverse/apps/create-an-app/forms/settings/child-forms)
* [Report templates](https://viewzenlabsug.gitbook.io/userguides/appverse/apps/create-an-app/forms/settings/report-template)
* [Data formatting rules](https://viewzenlabsug.gitbook.io/userguides/appverse/apps/create-an-app/forms/settings/data-formatting-rules)
* [Quick filters](https://viewzenlabsug.gitbook.io/userguides/appverse/apps/create-an-app/forms/settings/quick-filters)
* [Allocation](https://viewzenlabsug.gitbook.io/userguides/appverse/apps/create-an-app/forms/allocation)
* [Advanced Search](https://viewzenlabsug.gitbook.io/userguides/appverse/apps/create-an-app/forms/advanced-search)

### Structure of a Conditional Block

A condition block in Appverse comprises of four components

* ***Conditional field*** - This is the field on which the condition is applied. It can be a form input field or a system-generated field.
* ***Operator*** - Determines how the conditional field is compared against a value.
* ***Value*** - The specific value against which the conditional field is evaluated.
* ***Add another additional block*** - This creates an additional conditional block at the same level or as a child within the conditional hierarchy.

<figure><img src="https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FPW7maGIRF9OL1VoOONMG%2Fconditionalblock.jpg?alt=media&#x26;token=b53abcda-ddda-40fc-a16e-487aef8679db" alt=""><figcaption><p>Conditional Block in Appverse</p></figcaption></figure>

### Conditional field

#### Appverse System Generated Fields

The following system fields can be used in the conditional statements

* Created by
* Modified by
* Status
* Lock Record
* Created At
* Modified At
* Version -> The version of the data.
* Source -> Start - The start date and time of data capture.
* Source -> Today - The date on which the data was captured.
* Source -> Username - The user who captured the data.
* Source -> [Instancename ](https://viewzenlabsug.gitbook.io/userguides/appverse/apps/create-an-app/forms/create/get-familiar/instance-name)- The identifier for the record.
* Source -> Timespent - The time taken to capture the data.
* Source -> Location - The location at which the data was captured.
* Source -> Appversion - The version of Appverse Mobile Web at the time of data capture.
* Source -> Phonenumber - The phone number of the user who captured the record.
* Source -> Deviceid - The device id.
* Source -> Devicemodel - The device model.

#### Form Input Fields

Currently, the following form input fields can be used in the conditional statements

* *Text*
* *Integer*
* *Decimal*
* *Select One*
* *Select Multiple*
* *Date*
* *Time*
* *Date & Time*
* *Calculate*

#### Identifying the different fields and their types

* *Text -* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FUTvAwA8bwIkGMemnuUOJ%2Fimage.png?alt=media\&token=90184a0c-d2d3-4bf0-8b8c-e7d1a87b40e4)
* *Integer -* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FFS2QHslVU5mpoL8wKzYY%2Fimage.png?alt=media\&token=c277c82b-a0a1-4a24-936f-04b55d91effe)
* *Decimal -* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2F512FwAAXYgi7zdtjPF8x%2Fimage.png?alt=media\&token=74b483a8-8804-4fde-bb08-63ca9ba74050)
* *Select One -* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FMWGSVuutZcOUX8GpGyvk%2Fimage.png?alt=media\&token=433eb4ae-3f0b-4fcc-b80f-e725b8ac7156)
* *Select Multiple -*![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2F1ZvgRxUPMmlVy2g4U3ud%2Fimage.png?alt=media\&token=652a0bc0-ce79-4287-9e27-a2367b4083e2)
* *Date -* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FBf4nSyIFawVU47d1cGhk%2Fimage.png?alt=media\&token=5afc53f2-cce4-4457-8da7-cf688cad887b)
* *Time -* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FD4KqwrhVInRjPuiXTNz0%2Fimage.png?alt=media\&token=7ed58077-abb7-40ca-bcf9-714b1060969d)
* *Date & Time -* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FdQshA1IH1BkUaAE3CLXJ%2Fimage.png?alt=media\&token=e295a9d6-9988-4053-b38d-5d8ec5192c26)
* *Calculate -* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FEwMX3muDeETWt3xJxbA7%2Fimage.png?alt=media\&token=c17581c3-2c70-44f7-b0b7-ef0be8b8e113)
* *Appverse System Fields - These fields are prefixed with a black dot followed by the data type of the field. E.g.* ![](https://2529980633-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK8cCKBpIeUsWEwOw3Fbj%2Fuploads%2FOlNKp9IRw3HEzGaaZoyy%2Fimage.png?alt=media\&token=f3ff318e-d87e-4710-87e3-70587c844107)

### Operators

The following operators are supported in Appverse conditional statements

* *Equal To* - Applicable only for all valid input fields. Verifies if there is an exact match with the provided value.
* *Not Equal To* - Applicable only for all valid input fields. Ignores records for which there is an exact match with the provided value.
* *In* - Applicable only for all valid input fields. Checks for an exact match with any one of the values provided in the IN condition.
* *Not In* - Applicable only for all valid input fields. Ignores records for which there is an exact match with any one of the values provided in the IN condition.
* *Exists* - Applicable only for all valid input fields. Checks if a value exists for the field and compares it against a true or false input.
* *Greater than* - Applicable only for number and date input fields. Checks if the data is greater than the provided value.
* *Greater than or Equal To* - Applicable only for number and date input fields. Checks if the data is greater than or equal to the provided value.
* *Less than* - Applicable only for number and date input fields. Checks if the data is lesser than the provided value.
* *Less than or Equal To* - Applicable only for number and date input fields. Checks if the data is lesser than or equal to the provided value.

### Value

#### Static Value

A **Static Value** is a fixed, predefined value that does not change dynamically based on user input or system conditions. It is manually entered or selected from a list of allowed values during configuration.

### Add other Conditional Blocks

* **Outermost conditional blocks** - All the outermost conditional blocks are at the same hierarchy and are joined by an AND statement.
* **Nesting in conditional blocks** - Conditional statements can be nested infinitely. All the conditions at the same level can either be joined by an AND or by an OR statement.

{% hint style="success" %}
**Tip**

To enter multiple static values in the value field, press Enter after each distinct value.
{% endhint %}
