# If

> `System.Activities.Statements.If`

`System.Activities.Statements.If`

Enables your project to take one of two different courses of action, depending on whether a specified condition is met. This activity contains a **Condition**, a **Then** branch, and an optional **Else** branch. The **Condition** field must contain a Boolean expression according to which either the **Then** or the **Else** branch is executed. The **Then** branch comprises the activities to be performed if the condition is true. The optional **Else** branch comprises the activities to be performed if the condition is false. To display the Else branch, click **Show Else** in the body of the activity.

For more complex scenarios, you can use the [Else If](https://docs.uipath.com/activities/other/latest/workflow/if-else-if) activity.

To learn how to use this activity, see:

* [Tutorial: Working with Files and Folders](https://docs.uipath.com/studiox/docs/tutorial-working-with-files-folders).
* [Tutorial: Iterating through Rows in a Table](https://docs.uipath.com/studiox/docs/tutorial-iterating-trough-rows-in-a-table).
* [Tutorial: Comparing Excel Files and Emailing Reconciliation Errors](https://docs.uipath.com/studiox/docs/tutorial-comparing-excel-files-and-emailing-reconciliation-errors).

## Project compatibility

**Windows** | **Windows - Legacy** | **Cross-Platform**

## Windows and Cross-Platform Configuration

* **Condition** - The condition to evaluate which activity to execute.
* **Then** - The activity to execute in case the condition is true, add it using the plus icon, or drag and drop it here.
* **Else** - The activity to execute in case the condition is false, add it using the plus icon, or drag and drop it here.

## Windows - Legacy Configuration

#### **From the activity body**

* **Condition** - The condition to evaluate which activity to execute.
* **Then** - The activity to execute in case the condition is true, add it using the plus icon, or drag and drop it here.
* **Else** - The activity to execute in case the condition is false, add it using the plus icon, or drag and drop it here.

#### **From the properties panel**

**Common**
* **DisplayName** - The name displayed for the activity in the Designer panel.

**Misc**
* **Condition** - The condition to evaluate which activity to execute.
* **Private** - If selected, the data used in the activity is not logged.

This activity is built by Microsoft. For more information, see [the official Microsoft documentation](https://msdn.microsoft.com/en-us/library/ee829548.aspx).
