# Redirects and endings

**Redirects** and **Endings** determine what happens when a responder reaches the end of a form—or any point within the flow where redirection is appropriate. Redirects can be configured globally (at the end of the flow) or locally (at a specific step), and both options support conditional logic for personalized experiences.

### Redirects

Redirecting users is essential for connecting multiple applications or flows, and Formsort offers flexible options to support complex navigation logic.

#### **Types of Redirects**

**1. Global (Default) Redirects**\
Set in the **Endings** group of the Content Editor, default redirects occur when a responder reaches the end of a form **without triggering any earlier step-level redirects**.

* If no default redirect is configured, the responder will see a plain confirmation screen with optional text.

<figure><img src="https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FzSqmERiOaw0IRob5lGTt%2Fimage.png?alt=media&#x26;token=31adc13b-8b7a-46a1-811c-4dd171cea149" alt=""><figcaption><p>Setting a default redirect</p></figcaption></figure>

**2. Step-Level Redirects**\
Redirects can also be defined on a per-step basis. Select a step and open the **Redirect** tab to configure.

* Step-level redirects can only use variables that have been defined by that step.
* If a step-level redirect has no condition, it will trigger automatically when the step is completed, finalizing the flow.

<figure><img src="https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FXZha27yYS6W8fMOo3wKP%2Fimage.png?alt=media&#x26;token=61854e21-d38c-4c1f-96ea-40de9b680ef3" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
Redirects always finalize the form, unless configured to open in a new tab.
{% endhint %}

***

### Configuring Redirect Behavior

#### Open redirect in new tab?

If enabled, the redirect will open in a new browser tab. This is useful when linking to a supplemental page (e.g., terms and conditions) without finalizing the form.

#### Adding query parameters to redirect URLs

<figure><img src="https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FW2CKXceRN8DLt3Fq0h32%2Fimage.png?alt=media&#x26;token=e3f667af-0bc0-4476-b3d3-c3b60751625b" alt=""><figcaption></figcaption></figure>

You can append query parameters to any redirect URL using the standard format:

```http
https://redirect-out-url.com?item1=value1&key2=value2
```

To pass values collected during the flow, use templating syntax:

```http
https://redirect-url.com?email={{responder_email}}
```

{% hint style="info" %}
**Fallback values**

When using templated variables, it is recommended to specify fallback values to avoid broken redirects if the variable is not defined at runtime.
{% endhint %}

***

### Redirecting into Formsort

Formsort supports redirection **into** a flow with data passed via URL parameters.

Example:

```arduino
https://flow.formsort.com/client/acme/flow/signup/variant/default/?utm_source=google
```

* Use [**external variables**](https://docs.formsort.com/response-data-collection-and-management/variable-schema/external-answers) to capture data from the incoming URL.
* Define the external variable in your flow schema (e.g., `utm_source`) so Formsort knows to bind the incoming value.
* Formsort will automatically ingest and assign the value to the matching variable.

{% hint style="info" %}
An external variable does not need to be created for answers that are already created in questions.
{% endhint %}

***

## Accessing the expected redirect URL as an answer

You can reference the **current expected redirect URL** as a [System library answer](https://docs.formsort.com/response-data-collection-and-management/variable-schema/system-library-answers).&#x20;

This is useful if you want to:

* Display the expected redirect URL to the user
* Include it in a submission payload
* Log it for analytics purposes

<figure><img src="https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FxGdEw69vHni6cfEBNaxQ%2Fimage.png?alt=media&#x26;token=2c9047da-db50-4cfd-ba9d-962c0f57ef46" alt=""><figcaption></figcaption></figure>

***

## Endings

The **Endings** group is a default, non-removable section at the end of every flow. It serves two primary purposes:

#### 1. Configure Default Redirects

From the Endings group, define the default behavior when a responder completes the form:

* One or more conditional redirects using form logic
* A single unconditional redirect for all users

These act as a fallback if no step-level redirect has been triggered earlier in the flow.

<div align="left"><figure><img src="https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FYEyI60t4AHVHUsUhO5JZ%2Fimage.png?alt=media&#x26;token=2468ab78-22ac-46a0-a1b3-5f936b63ee0b" alt="" width="563"><figcaption></figcaption></figure></div>

#### 2. Display Confirmation Text

If no redirect is configured, you may provide a simple **confirmation message** to be shown as the final screen.

* The screen is unstyled and cannot be customized.
* Use only if you have no destination to send users to or wish to keep the experience minimal.

<figure><img src="https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FqQzXFWWC4153qupCC1Hl%2Fimage.png?alt=media&#x26;token=a2faf863-2a3d-44c2-8caa-110586b42aae" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
⚠️ We generally recommend using a styled last step or redirect URL instead of  plainconfirmation text for better user experience and branding consistency.
{% endhint %}
