End logic: choosing an ending
Use end logic to show a respondent one of your form’s endings based on their answers. The first matching condition wins; if none match, Makeform uses the default ending.
How ending selection works
Add an end_logic object with a conditions array and a default ending ID. Each condition has an if condition array and a go_to ending ID.
At submit, the server chooses the ending after it recomputes calculations. If no condition matches and there is no default, the first end page is used. A malformed branch is skipped.
End logic runs in page and tally modes, and when mode is unset. Publish rejects end logic if the form has no endings, a target is missing, a redirect URL is invalid, or an ending is unreachable.
Example: choose an ending from an answer
This form directs respondents who choose “Business” to a sales ending. Everyone else sees the general ending.
{
"mode": "page",
"pages": [
{
"type": "form",
"id": "p1",
"ui": [
{
"type": "multiple_choice",
"name": "plan",
"label": "Which plan are you interested in?",
"options": ["Personal", "Business"],
"required": true
}
]
}
],
"end": [
{
"id": "e0",
"type": "end",
"ui": [
{
"type": "text",
"copy": "Thanks for your interest. We’ll be in touch."
}
]
},
{
"id": "e1",
"type": "end",
"ui": [
{
"type": "text",
"copy": "Thanks for choosing Business. Our team can help with next steps."
}
]
}
],
"end_logic": {
"conditions": [
{
"if": [
{
"field": "plan",
"operator": "equals",
"value": "Business"
}
],
"go_to": "e1"
}
],
"default": "e0"
}
}Example: route qualified respondents to a redirect
This form sends respondents with a budget greater than 10,000 to a scheduling page. Other respondents see the standard ending. Redirect URLs support {{field}} piping; the answer is URL-encoded.
{
"mode": "page",
"pages": [
{
"type": "form",
"id": "p1",
"ui": [
{
"type": "number_input",
"name": "budget",
"label": "What is your project budget?",
"min": 0,
"required": true
}
]
}
],
"end": [
{
"id": "e0",
"type": "end",
"ui": [
{
"type": "text",
"copy": "Thanks. We’ll follow up about your project."
}
]
},
{
"id": "e1",
"type": "end",
"variant": "redirect",
"redirect_url": "https://example.com/schedule?budget={{budget}}",
"redirect_delay": 3,
"disable_leaving_notice": true,
"ui": []
}
],
"end_logic": {
"conditions": [
{
"if": [
{
"field": "budget",
"operator": "greater_than",
"value": 10000
}
],
"go_to": "e1"
}
],
"default": "e0"
}
}End pages and redirects
End pages hold display blocks only. Publish rejects input fields on an end page. For a redirect ending, set variant to redirect and provide a valid redirect_url. redirect_delay is in seconds and defaults to 3.
In a redirect URL, arrays are joined with commas and objects become empty strings. Endings must be reachable through the logic or its fallback.