---
title: If Conditional 
slug: singleconnect-reference-guide-3-1-0/if-conditional
description: Learn how to use the if condition in an ExclusiveGateway statement with our comprehensive guide. Discover the step-by-step process for setting the condition using JavaScript expressions, which can be based on previous step's output parameter. Enhance your
docTags: 
createdAt: 2022-08-02T15:36:59.000Z
---

If desired, the **if&#x20;**&#x63;ondition can be used by making a comparison of the value of the output with the **ExclusiveGateway** statement.

![](https://api.archbee.com/api/optimize/g9cApVza9NIhSh0pjZYtA/0qvA4WYqo5G0fzV5Ib9AZ_image.png "If Conditional")

For example, a workflow has been created in the figure below. There is a CLI Task in the first step with its output parameter. In the second step, the condition is executed according to the result of the output parameter.

![](https://api.archbee.com/api/optimize/g9cApVza9NIhSh0pjZYtA/fIXeD0vAP92mB00XoGEr6_image.png "If Conditional ")

1. Clic&#x6B;**&#x20;connect tool**.
2. The **Propertiesn&#x20;**&#x74;ab is displayed to the right of the screen.
3. Enter the condition information.
4. Enter the condition name in the Name field
5. Select **Expression** from the Condition Type drop-down menu
6. Enter the conditional into the Expression field.

![](https://api.archbee.com/api/optimize/g9cApVza9NIhSh0pjZYtA/cbeDokFzclk9Op5aeZ2EW_image.png "-If Conditional")

The Expression field type must be in JavaScript. **hostname&#x20;**&#x69;s the output parameter of the previous step.

::Image[]{src="https://api.archbee.com/api/optimize/g9cApVza9NIhSh0pjZYtA/Zjpkxa9jezetdmi1RaMzp_image.png" size="28" width="272" height="409" caption="If Conditional definition" position="center" showCaption="true"}

![](https://api.archbee.com/api/optimize/g9cApVza9NIhSh0pjZYtA/wwzVRqwoXQ5DRM5iugbqN_image.png "If Conditional")

