# exit\_loop

The `exit_loop` statement will terminate the current loop.

{% hint style="info" %}
Either `exit_loop` or `loop_exit` may be used. Both variants work identically.
{% endhint %}

## Syntax

`exit_loop`

## Details

The `exit_loop` statement will immediately terminate the current loop and script execution will jump to the statement following the `}` at the end of the current loop.

This can be done even if the `exit_loop` statement is within one or more [if](/2.10.2/data-pipelines/extract/language/if.md) constructs inside the loop.

If no loop is in effect then an error will be logged and the script will terminate.


---

# 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://olddocs.exivity.io/2.10.2/data-pipelines/extract/language/exit_loop.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.
