> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/generic/loops-and-condition-operations-1/endif.md).

# EndIf

This action in Avo Assure is available under the **@Generic Element**. Its functionality is to close the If condition statement after executing the conditional logic. Without the **EndIf** action, the If condition cannot execute correctly and results in a dangling error.

## Syntax

**Input Value**: N/A

| Argument | Description    |
| -------- | -------------- |
| N/A      | Not Applicable |

**Output Value**: N/A

| Argument | Description    |
| -------- | -------------- |
| N/A      | Not Applicable |

### Example: Marking the End of a Conditional Part

In this example, we explain how to mark the end of an **If** condition during test execution using the **EndIf** action.

* **Action**: EndIf
* **Input Value**: Not Applicable
  * The **EndIf** action does not require any input value. It is used to indicate the completion of an **If**, **ElseIf**, or **Else** condition part within the test execution flow.
* **Logical Explanation**: The **EndIf** action acts as an end point that marks the completion of a conditional part. When this action executes, it informs Avo Assure that the entire conditional structure, whether it is an If, Else If, or Else part, is fully processed. This helps maintain the correct logical flow, ensuring that the execution proceeds properly to the next test steps outside the conditional part.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2Fngn2ym2E1LzRpkiFuuZ3%2Fimage.png?alt=media&amp;token=1c6da38a-2534-43d2-9b82-d1e2bc6b2ecf" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
