# Else-If

This is a pre-built Action located under the **@Generic Element**. The functionality of this action in Avo Assure is to evaluate whether the specified condition is satisfied. If the initial If condition fails, the **Else-If** part is executed as an alternative conditional part. The result is stored in the given dynamic variable for further use during test execution..

{% hint style="info" %}
**Note**: Without **If** action we cannot execute **Else-If** action.
{% endhint %}

## Syntax

**Input Value**:`(<operand1>;<operator>;<operand2>)`&#x20;

| Argument                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>\<operand1><br>(Required)</p> | <p>Provide the first value which you want to compare against operand2. <br>This can be a static value or a dynamic variable. <br>Supported input formats:  </p><p><strong>Number</strong> and <strong>String</strong> </p>                                                                                                                                                                                                     |
| <p>\<operator><br>(Required)</p> | <p>This is the comparison operator.  </p><p>Supported operators include: </p><p><strong>></strong>, <strong><</strong>, <strong>==</strong>, <strong>>=</strong>, <strong><=</strong>,<strong>!=</strong>, <strong>in</strong>, <strong>not in</strong> along with the logical operators <strong>AND</strong>, <strong>OR</strong>, <strong>NOT</strong>. </p><p><strong>Note</strong>: The operators are case-sensitive. </p> |
| <p>\<operand2><br>(Required)</p> | <p>Provide the second value which you want to compare against operand1. <br>This can be a static value or a dynamic variable.  </p><p>Supported input formats:<br><strong>Number</strong> and <strong>String</strong></p>                                                                                                                                                                                                      |

**Output Value**: \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional)

<table><thead><tr><th width="331.33343505859375">Argument</th><th>Description</th></tr></thead><tbody><tr><td>&#x3C;Dynamic Variable>(Optional);&#x3C;Dynamic Variable>(Optional)</td><td>Both dynamic variable stores the status as <strong>True</strong> or <strong>False</strong>.</td></tr></tbody></table>

### **Example 1: Evaluating an Additional Condition When the Initial If Condition Fails**

In this example, we explain how to evaluate another condition when the first If condition does not meet the defined criteria.

* **Action**: Else-If
* **Input Value**: ({Income};==;60000)
  * The variable (**{Income}**) specifies the dynamic variable whose value is being evaluated. In this scenario, the value stored in the **{Income}** variable is 60000.
  * The operator (**==**) defines the comparison rule. This operator checks whether the value of the variable **{Income}** is equal to the specified number (60000).
  * The number (**60000**) specifies the threshold against which the **{Income}** value is compared.
* **Output Value**: {Status}
  * The result of the evaluate operation is stored in the **{Status}** dynamic variable with the following possible values:
    * **True**: If the Else-If part executes successfully.
    * **Fales**: If the Else-If part does not execute because the If condition is fulfilled.
* **Logical Explanation**: The **Else-If** action evaluates the condition defined in the **Input Value** column (**({Income};==;60000)**), but only after the initial If condition evaluates to false. In this scenario, the value stored in the **{Income}** variable is 60000, which satisfies the condition. If the condition is true, the actions inside the **Else-If** block are executed. In this scenario, the **Display Variable Value** action displays the value of the **{TaxRate2}** variable (20%). The result of the evaluation operation (True) is stored in the **{Status}** variable.

<figure><img src="/files/jSAw90Kk4INlmyr3UI3C" alt=""><figcaption></figcaption></figure>

### **Example 2: Verifying String Presence When the Initial If Condition Fails**

In this example, we explain how to evaluate whether the value stored in one variable exists within another string or variable, but only when the previous If condition evaluates to false.

* **Action**: Else-If
* **Input Value**: ({Department};in;Technology)
  * The variable (**{Department}**) specifies the variable containing the value to be evaluated. In this scenario, the value stored in the **{Department}** variable is Technology.
  * The operator (**in**) defines the comparison operator used to check whether the value from the dynamic variable exists within another provided string or variable.
  * The string (**Technology**) specifies the exact string in which the search will be performed.
* **Output Value**: {Status}
  * The result of the evaluate operation is stored in the **{Status}** dynamic variable with the following possible values:
    * **True**: If the Else-If part executes successfully.
    * **Fales**: If the Else-If part does not execute because the If condition is fulfilled.
* **Logical Explanation**: The **Else-If** action evaluates the condition provided in the **Input Value** column (**{Department};in;Technology**). When the initial If condition has already failed. It checks whether the value stored in the **{Department}** variable (Technology) exists within the comparison string **Technology**. In this scenario, the value matches, so the **Else-If** condition evaluates to true, and the steps inside the **Else-If** part are executed. If the condition were false, execution would move to the next Else If block or end the loop part.

<figure><img src="/files/QMUSvlKlBG4VbJkuW6oK" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/loops-and-condition-operations-1/else-if.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
