# 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="/files/lYzN9q8w0AeyBNSWfKn6" 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="/files/5uxvpH1PzLLMKVtDTi4I" 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="/files/ihQ2auHbcTREy1GGEguY" 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**](/response-data-collection-and-management/variable-schema/external-answers.md) 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](/response-data-collection-and-management/variable-schema/system-library-answers.md).&#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="/files/ces05VQBx6ZibskHIXD1" 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="/files/jDZLD3odvy5WYqkQEAG8" 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="/files/pgPCALe3af0orlALjM3t" 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 %}


---

# 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.formsort.com/redirects-and-endings.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.
