Fillout logo Fillout automation

Add conditional logic and page branching to a Fillout form

A form that asks everyone the same ten questions loses people on the ones that do not apply to them, and logic fixes that, one condition and one page connector at a time in the editor.

Cotlet does it in your own Fillout account with get_form, get_form_logic, set_question_logic and set_page_branch, called by your AI agent, an n8n workflow or a script.

Hosted · nothing to install or maintain

Can Fillout do this on its own?

Fillout's Form Agent can set up page logic that routes respondents by their answers, but only in the chat inside one form's editor (checked 17 Oct 2026). The REST API's form metadata lists questions, calculations and URL parameters, not logic, and it has no endpoint to change any of it.

How you do it in Fillout today

  1. Open the form, click the settings icon on a field and open the Logic section in the right-hand panel, then Set conditional logic.
  2. Click + Add condition and base it on a previous input, a URL parameter, data from an integration or date information.
  3. To route pages, click Logic at the top, drag from the page's connector to the target page and click Set condition.
  4. Repeat for each scenario with + Add branch, then Publish so the changes reach respondents.
  5. Every new field or page means going back into Logic, because a branch does not follow a renamed or added question by itself.

How to add conditional logic and page branching to a Fillout form

Prompt

In "Discount application", skip the "Describe your organization" question unless the company type is Non-profit, and send students straight to the Accepted ending page and private companies to Rejected.
  1. 01

    Read the form and its current logic

    get_form gives the questions and their IDs, get_form_logic the conditions and branches already there, so a new rule does not collide with an old one.

  2. 02

    Turn the rule into conditions

    Each sentence of your brief becomes a condition on an earlier answer or a URL parameter. A rule that depends on integration data is reported to you, because that condition is set in the app.

  3. 03

    Hide fields that do not apply

    set_question_logic sets hide_when on the question, or hide_always for a field that only carries a pre-filled value such as a referral code.

  4. 04

    Connect the pages

    set_page_branch adds one branch per scenario from the page that asks the question. The agent also adds a default branch for answers no rule covers, so nobody reaches a dead end.

  5. 05

    Check before publishing

    get_form_logic is read again and listed back to you. Edits stay in the editor until publish_form runs, which waits for your OK.

What you get back

Example data

Form "Discount application"
Question "Describe your organization": hidden unless Company type is Non-profit
Branch: Info > Accepted when Company type is Student
Branch: Info > Rejected when Company type is Private company
Branch: Info > Non-profit page when Company type is Non-profit
Not published yet

Other ways to ask

  • Hide "Billing address" when the URL parameter source is internal.
  • Add a Rejected ending for everyone who answers No to the eligibility question and list the branches you changed.
  • Show me every condition and branch in this form as a table, and change nothing.

What Fillout allows, and what to know first

  • Fillout conditions can use previous form inputs, URL parameters, data from an integration or date information.
  • Hide always is a switch on a field, meant for pre-filling a value respondents must not change, such as a referral code.
  • Page logic is edited under Logic at the top of the editor by dragging a connector from one page to another and setting a condition on each branch.
  • Fillout's docs say to Publish the form to make logic changes reflect, so a branch set in the editor is not seen by respondents before then.
  • Fillout keeps an edit history behind the clock icon in the editor, where a version from before a bulk change can be restored.

set_question_logic and set_page_branch change only your own Fillout data and reach no one else, so they run without asking first.

Sources: Fillout Help: Conditionally hide fields · Fillout Help: Form page logic · Fillout Help: Build forms with Form Agent · Fillout Help: Restore previous form version

Call set_question_logic from a script

curl

curl -X PUT https://cotlet.dev/api/v1/fillout/forms/rK8mTn4vYb1C/questions/q_org_description/logic \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hide_when":[{"source":"answer","question_id":"q_company_type","operator":"is not","value":"Non-profit"}]}'

Example response

{
  "form_id": "rK8mTn4vYb1C",
  "question_id": "q_org_description",
  "hide_always": false,
  "hide_when": [
    {
      "source": "answer",
      "question_id": "q_company_type",
      "operator": "is not",
      "value": "Non-profit"
    }
  ]
}

MCP: add https://cotlet.dev/mcp/v1 with the same key; the call is fillout_write → set_question_logic. Example data.

Schedule it in n8n, Make, Zapier or cron

Fillout tools this automation uses

Cotlet Fillout tools used to add conditional logic and page branching to a Fillout form
Tool Parameters
get_form form_id
get_form_logic form_id
set_question_logic form_id, question_id, hide_when, hide_always
set_page_branch form_id, from_page, to_page, condition
All 15 Fillout tools with descriptions

Frequently asked questions

Is it safe to connect Fillout to Cotlet?

Yes. You sign in to Fillout yourself, in your own Cloud Browser in the EU, and we never save your password. Your agents only get Fillout once you enable it, every background request is listed, and the browser profile is stored encrypted with AES-256-GCM, the cipher 1Password uses for its vaults. The AI model never sees a login, posts and messages wait for your OK, and Disable for agents cuts access in one click. Independent scanners grade cotlet.dev A+ on Qualys SSL Labs, securityheaders.com and Mozilla Observatory; live results are on https://cotlet.dev/security.

Give your agent access to Fillout.

Free 7-day trial with 2,000 credits, no card needed. Cotlet is independent and not affiliated with Fillout.