Terminal Redirects
Terminal redirects let a Survey Link route respondents to an external URL after the survey reaches a terminal status. If no <redirect> block exists, the current default end page is used and exported response data stores redirectGroup as null.
Minimal default
A redirect block is optional. When authors enable it from GUI Mode or HTML Mode, exactly one default group must exist. A single saved group is canonicalized with default automatically.
<redirect>
<group title="Default Group" default />
</redirect>
Rules:
<redirect>may appear at most once in the survey source.<redirect>may contain multiple<group>tags.- Exactly one redirect group must be marked
defaultwhen<redirect>exists. - A survey without
<redirect>keeps the built-in terminal page and savesredirectGroupasnull. - If a respondent supplies a redirect group path or
?redirectGroup=but the survey has no<redirect>block, Survey Link blocks access and does not save a response.
Groups
Redirect groups choose which terminal route list is active for a respondent.
<redirect>
<group title="Default Group" default />
<group name="v1" title="Control list" />
<group name="v2" title="Partner list">
<route url="https://example.com/complete" if="$status.complete" />
<route url="https://example.com/screenout" if="$status.screenout" />
<route url="https://example.com/quotafull" if="$status.quotafull" />
</group>
</redirect>
| Attribute | Required | Meaning |
|---|---|---|
name | No | URL-selectable group key. It follows the same programming-style naming rule as other variable names: start with a letter, then letters, numbers, or _. |
title | No | Author-facing label shown in GUI Mode. |
default | One group | Fallback group for the base Survey Link URL. |
Group rules:
- Group-level
ifis not supported in redirect groups. - Group
namevalues must be unique inside one<redirect>block. - At most one group may omit
name. - A named default group is valid. If
name="v3" defaultis selected, the bare Survey Link URL canonicalizes to/s/{surveyId}/v3and savesredirectGroupas"v3". - An unnamed default group selected from the bare Survey Link URL saves
redirectGroupasnull.
Routes
Routes are evaluated only after the respondent reaches a terminal status such as complete, screenout, or quota full.
<redirect>
<group name="v3" title="Template route" default>
<route
url="https://test.com?source={{ $params.source }}"
if="$status.complete && Q1.o1"
/>
</group>
</redirect>
| Attribute | Required | Meaning |
|---|---|---|
url | Yes | Absolute http or https destination. Template Expressions are supported. |
if | Yes | Expression evaluated with the final answers and $status helper. |
Route rules:
- Routes run in source order. The first route whose
ifexpression is true wins. - If no route matches, Survey Link shows the built-in default terminal page.
- Duplicate
ifexpressions inside the same group are hard errors. - Unsafe or invalid final URLs block the terminal save and display a redirect configuration error.
- Template Expression errors in route URLs are treated as redirect errors rather than silently navigating.
- Template Expression values are URL-component encoded before insertion, so respondent answers and
$paramsvalues cannot add extra query parameters or reshape the destination URL.
Route helper context
Redirect routes evaluate after the final response status is known. The route if expression can read:
- Final answer Question Objects such as
Q1.o1orAGE.value. $status.complete,$status.screenout, and$status.quotafull.$paramsvalues from the Survey Link URL after reserved system keys are removed.$nowandLuxondate helpers.- Registered safe script helpers.
Route URL Template Expressions use the same answer/helper context except that $status is only meaningful for route matching. $curr is not available because redirect evaluation is terminal and not tied to a current question.
<route
url="https://example.com/complete?source={{$params.source}}&year={{$now.year}}"
if="$status.complete && Q1.o1"
/>
URL selection and stored data
Survey Link resolves the redirect group from the path first, then the query string:
| URL | Selected group | Saved redirectGroup |
|---|---|---|
/s/{surveyId} | Default group | Named default: group name. Unnamed default or no redirect: null. |
/s/{surveyId}/v1 | name="v1" | "v1" |
/s/{surveyId}?redirectGroup=v2 | name="v2" when no path group exists | "v2" |
/s/{surveyId}/v1?redirectGroup=v2 | name="v1" | "v1" |
redirectGroup is response metadata and appears in response export output. The redirectGroup query key is reserved for group selection and is not exposed through $params.
TEST and LIVE behavior
- TEST mode does not auto-navigate. It shows a redirect preview card and an explicit destination link.
- LIVE mode navigates only after response persistence succeeds or is intentionally skipped by the runtime’s existing terminal behavior.
- Any redirect configuration, group selection, or unsafe URL error blocks progression before persistence, so invalid redirect responses are not stored.
GUI Mode editing
Open the existing Survey Link settings dialog from Workbench. The dialog keeps the current survey-config column and adds a Redirect column.
GUI Mode supports:
- Disabled redirect state for surveys that should keep the default terminal page.
- Default group selection through a radio control.
- Group accordions with
nameandtitlefields. - Route editors for
urlandif. - Add/remove controls for groups and routes.
- Template Expression highlighting in route URL fields.
When only one group remains, GUI Mode keeps that group as the default and disables deletion until another group is added.