# Early Return

The Early Return Data Operation verifies the validity of an expression and sets the Return Value if the validation is not passed. When the validation fails, all subsequent steps are skipped (exit the current flow) and the Return Value is return instead, in a Try/Catch fashion.

This Data Operation can be used as a step in [Data Flows](../studio/data-flows) and [API Endpoints](../../building-apps/integration-guides/building-an-app-api#validating-the-request) alike.

![](https://4185914948-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSItjRhbHaLQ4ar3DUljt%2Fuploads%2Fgit-blob-baf1e39b6eea1134082a05df0128b9843b8e3b8b%2Fearly-return-v181-0.gif?alt=media)

## Use Cases

* Set a Data Flow return when validation of input data fails
* Set API call response when payload validation fails

## Data Operation Properties

### Validity Check

Expects type `boolean`.

This [conditional expression](https://support.airkit.com/v18.0/reference/if) allows the app builder to set conditions to evaluate whether the input is considered valid or not.

### Return Value if Validation Fails

An expression (Text, number, JSON object, etc.) containing the value to return if the Validity Check expression returns `FALSE`.

#### `connection` variable

When using the Early Return data operation in App APIs, the return value if the validation fails is stored in a variable called `connection`.

## Run Results

The result is a [Boolean](../variable-data-types/the-boolean-variable-data-type). If the returned value is `TRUE`, all the subsequent steps are run, otherwise they are skipped and the Data Operation's Return Value is returned instead.
