set_pages
Split a form into steps
Turn a form into a multistep form (a funnel/wizard) by defining ordered pages/steps and which fields go on each — or make it single-page again by passing an empty pages list. Use this DIRECTLY (no need to call get_form first) whenever the user asks to split, group, break up, or reorganize a form's questions into steps, pages, sections, or funnel stages ('make it multistep', 'split into three steps', 'group questions into pages', 'typeform-style funnel'). Validation is self-correcting: if a field key is wrong, the error lists the existing keys. Sets the form's layout to 'paged' (or back to 'single' when cleared). To show one question at a time WITHOUT named pages, use update_form with settings.presentation.layout = 'focus' instead.
Defines the ordered steps and which fields sit on each. For one-question-at-a-time without named steps, focus layout via presentation settings is simpler. Guide: multistep forms.
| Parameter | Type | Description |
|---|---|---|
| form_id | string | Form id (authenticated). From create_form/list_forms. |
| draft_token | string | Draft token (anonymous drafts, before sign-in). From create_form's draftToken. |
| pages * | array of object | Ordered page list, each with a key, optional title/description, and the field keys on it. Empty list = back to single-page. |
| pages[].key * | string | Stable page identifier, lowercase letters/digits/underscores, e.g. 'about_you' |
| pages[].title | string | Step heading respondents see, e.g. 'About you' |
| pages[].description | string | Optional intro text under the step heading |
| pages[].fields | array of string | Field keys on this page, in order. Unlisted fields keep their page (or fall to the first page). |
* required