IF ELSE Functionality
The IF ELSE functionality is used to handle situations where actions depend on certain conditions being met. This allows for dynamic decision-making in your automation steps, so actions only run if specified conditions are met. In HuLoop, this is achieved through four commands:
- IF Command: Checks an initial condition and performs actions if it’s true.
- ELSEIF Command: Adds additional conditions to check if the original IF condition is not met.
- ELSE Command: Executes actions when none of the IF or ELSEIF conditions are met.
- ENDIF Command: Closes the IF ELSE block to indicate end of IF block.
If Statement: IF
The If Statement command checks if a condition is true and performs the designated actions if it is. This command starts the IF ELSE block and must be closed with ENDIF.
Example: Let’s say you want to compare two values and setting a variable based on the comparison result.
Suppose you have two predefined variables:
- Value 1 = 200
- Value 2 = 100
The automation should perform the following checks:
- If Value 1 is greater than Value 2 → Set another variable, Result = High
- Else → Set Result = Low (this part is explained in later section)
Steps to configure:
- Add a new step.
- Select If Statement from the Action drop-down.
- Leave the Screen Name blank.
- In Element Key, enter the value to be compared, e.g., Value 2.
- In Parameter, enter: STD_GREATERTHAN,${Value 1} (Value 1 is the reference value for comparison).
- Click Save.
Note: While the steps for adding an action command are identical in both views, the display of the steps changes:


Note: Ensure that the variables (Value 1 and Value 2) are already defined in the workflow before using them in conditions.
Outcome on Execution:
- Since Value 1 (200) > Value 2 (100), the IF condition is met, and the automation sets Result = High.
- If the condition is not met, the automation moves to the next part of the IF ELSE block, which will be covered in the Else statement section.
Refer to the screenshot below to see how an IF statement is visually represented in the workflow:
In the upcoming sections, we will configure ELSE and ELSEIF statements to handle additional conditions.
Else If Statement: ELSEIF
The Else If Statement command checks an additional condition if the IF condition wasn’t met. It allows you to handle multiple conditions sequentially before executing the final ELSE block.
Example: Checking an Alternative Condition
Building upon the previous example, suppose we now introduce an additional condition:
- Value 1 = 200
- Value 2 = 100
- Value 3 = 150 (New variable for additional comparison)
The automation should perform the following checks:
- IF Value 2 is greater than Value 1 → Set Result = High (already explained).
- ELSEIF Value 2 is equal to Value 3 → Set Result = Equal (new condition).
- ELSE → Set Result = Low (to be covered in the next section).
Steps to configure:
After setting up the IF condition, add ELSEIF:
- After configuring the IF statement, add a new step.
- Select Else If Statement from the Action drop-down.
- Leave the Screen Name blank.
- In Element Key, enter the variable to be compared, e.g., Value 2.
- In Parameter, enter STD_EQUALS, ${Value 3} (Value 3 is the reference value for comparison).
- Click Save.
Note: While the steps for adding an action command are identical in both views, the display of the steps changes:


Note: Ensure that all variables (Value 1, Value 2, and Value 3) are predefined in the workflow before using them in conditions.
Outcome on Execution:
- If the IF condition is met, ELSEIF is skipped, and the automation proceeds with the IF action.
- If the IF condition is not met, the automation evaluates the ELSEIF condition:
- If Value 2 (100) = Value 3 (150) → This is false, so ELSEIF is also skipped.
- If the ELSEIF condition is met, the automation sets Result = Equal.
- If neither IF nor ELSEIF conditions are met, the automation moves to the ELSE block (covered in the next section).
Refer to the screenshot below to see how an ELSEIF statement is visually represented in the workflow:
In the upcoming section, we will configure the ELSE statement to handle cases where neither IF nor ELSEIF conditions are met.
Else Statement: ELSE
The Else Statement command ensures that a defined step is executed when none of the previous conditions are met. It serves as the default fallback condition, ensuring that the workflow always has a defined next step.
It requires an ENDIF to close the block.
Example: Handling the Default Case
Continuing from the previous example, we now add an ELSE condition:
- Value 1 = 200
- Value 2 = 100
- Value 3 = 150
The automation should perform the following checks:
- IF Value 2 is greater than Value 1 → Set Result = High (already explained).
- ELSEIF Value 2 is equal to Value 3 → Set Result = Equal (already explained).
- ELSE → If neither condition is met, Set Result = Low.
Steps to configure:
After setting up the IF and ELSEIF conditions, add ELSE:
- Add a new step.
- Select Else Statement from the Action drop-down.
- Leave all other fields blank.
- Click Save.
Note: While the steps for adding an action command are identical in both views, the display of the steps changes:


Outcome on Execution:
- If either the IF or ELSEIF condition is met, the ELSE block is skipped.
- If both IF and ELSEIF conditions fail, the automation executes the ELSE block and sets Result = Low.
When checking multiple conditions, use multiple ELSEIF statements before the final ELSE to capture various scenarios.
Refer to the screenshot below to see how the ELSE statement is visually represented in the workflow:
In the upcoming section, we will configure the ENDIF statement to properly close the IF ELSE block.
Endif Statement: ENDIF
The Endif Statement command marks the end of the IF ELSE block, indicating that all conditions have been checked.
Steps to configure:
- After configuring the ELSE statement, add a new step.
- Select Endif Statement from the Action drop-down.
- Click Save.
Note: While the steps for adding an action command are identical in both views, the display of the steps changes:


Outcome on Execution:
- Once any condition (IF, ELSEIF, or ELSE) is executed, the workflow reaches ENDIF, signaling the end of the conditional block.
- The automation then proceeds to the next step outside the IF ELSE structure, if any.
Refer to the screenshot below to see how ENDIF is represented in the workflow:
With this, the entire IF ELSE structure is complete, allowing the automation to handle multiple conditions effectively.
Full Example Recap:
- IF: Check if Value 2 < Value 1; if true, set Result = High.
- ELSEIF: If Value 2 does not meet Value 1, check if Value 2 = Value 3 and, if true, set Result = Equal.
- ELSE: If neither condition is met, set Result = Low.
- ENDIF: Closes the conditional block.