Set page branch
Route respondents from one page to another when a condition is met.
PUT https://cotlet.dev/api/v1/fillout/forms/{form_id}/page-branch
write
Adds a branch from one form page to another, with a condition on an earlier answer, the same as dragging a connector in the Logic view. Leave condition empty to set the default path. Page names come from get_form_logic. The change reaches respondents only after publish_form, and it is undone by the editor's edit history, so it runs without asking first.
Parameters
| Name | Type | Description |
|---|---|---|
| form_id string required | string | Form ID from list_forms. |
| from_page string required | string | Name of the page respondents leave. |
| to_page string required | string | Name of the page, or ending page, they go to. |
| condition object | object | Branch condition: question_id, operator (as the condition editor offers it for that field), value. Empty means the default path. |
Request
curl -X PUT https://cotlet.dev/api/v1/fillout/forms/form_8c41d2/page-branch \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"from_page":"from page","to_page":"to page"}' result = client.call("fillout", "set_page_branch", {"form_id":"form_8c41d2","from_page":"from page","to_page":"to page"}) const result = await cotlet.call('fillout', 'set_page_branch', {"form_id":"form_8c41d2","from_page":"from page","to_page":"to page"}); cotlet call fillout set_page_branch --data '{"form_id":"form_8c41d2","from_page":"from page","to_page":"to page"}' Example response
{
"form_id": "rK8mTn4vYb1C",
"branch": {
"from_page": "Info",
"to_page": "Accepted",
"condition": {
"question_id": "q_company_type",
"operator": "is",
"value": "Student"
}
}
}