# Condition

## Introduction

This document provides a comprehensive guide to understanding and using the Condition component within the Automate platform. Conditions are essential programming commands used to process decisions based on boolean evaluations. The Condition component allows users to create logic branches and execute actions based on the results of these conditions.

The purpose of the Condition component is to facilitate the execution of different computations or actions depending on whether a programmer-defined boolean condition evaluates to true or false. It enhances the control and flow of actions within workflows by enabling users to create conditional logic.

## What is the Condition Component?

The Condition component in Automate allows users to create, configure, and execute various types of conditions. These conditions include IF, ELSE IF, and ELSE, each serving a specific purpose in decision-making processes.

#### Key Features

* <mark style="color:orange;">**IF Condition:**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">Perform actions based on whether a condition evaluates to true.</mark>
* <mark style="color:orange;">**ELSE IF Condition:**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">Additional conditions for sequential evaluation.</mark>
* <mark style="color:orange;">**ELSE Condition:**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">Actions executed when no prior conditions are met.</mark>
* <mark style="color:orange;">**Configurable Parameters:**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">Customize conditions based on boolean, string, number, date, data table, dictionary, length, or ping evaluations.</mark>
* <mark style="color:orange;">**Nested IF Clauses:**</mark> <mark style="color:orange;"></mark><mark style="color:orange;">Insert IF clauses within other IF clauses for complex logic.</mark>

## How To Use Action

### If

**Description:** The IF Condition allows users to create a decision branch based on a specified condition.

**Usage:**

1. **Create an IF Condition:**
   * Click on the "Add Condition" button in the configuration form.
   * Select the condition type from the drop-down menu.
   * Fill in the condition modal with the appropriate values:
     * **Boolean:** <mark style="color:green;">Compare true or false values.</mark>
     * **String:** <mark style="color:green;">Compare source and target values with operators like "is equal," "is not equal," "contains," "is empty," or "is not empty."</mark>
     * **Number:** <mark style="color:green;">Compare two numerical values or variables.</mark>
     * **Date:** <mark style="color:green;">Compare two date values or variables.</mark>
     * **Data Table:** <mark style="color:green;">Compare a data table variable for row or column count.</mark>
     * **Dictionary:** <mark style="color:green;">Compare two dictionary variables.</mark>
     * **Length:** <mark style="color:green;">Compare the length of two arrays or variables.</mark>
     * **Ping:** <mark style="color:green;">Check the availability of a selected IP address or machine.</mark>
   * Change the relation between conditions using "And" or "Or" from the configuration form.
   * Delete or edit the condition by clicking on the three dots on the right side of the condition.

**Sample String Condition:**

When the condition is met, drag and drop actions from the left activities menu into the IF action.

{% embed url="<https://drive.google.com/file/d/19NqKaAY9Pi9Dn2n3sD9fm0mZd7Vy7AUO/view?usp=sharing>" %}

### Else If

**Description:** The ELSE IF Condition allows users to add additional conditions for sequential evaluation.

**Usage:**

* <mark style="color:green;">Users cannot add ELSE IF conditions without preceding IF or ELSE IF conditions.</mark>

### Else

**Description:** The ELSE Condition defines actions to be executed when none of the prior conditions are met.

**Usage:**

* <mark style="color:red;">No "Add Condition" part is required for the ELSE Condition.</mark>

{% embed url="<https://drive.google.com/file/d/1612dbnHwLxckPD_EzopxW0zeAlmh6UzT/view?usp=sharing>" %}

***

## Additional Tips

### [**Use Cases**](https://docs.autommate.com/userguide/use-cases)

### [FAQ](https://docs.autommate.com/userguide/faq)
