[Cotlet](https://cotlet.dev/index.md) · [Integrations](https://cotlet.dev/integrations.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Use cases](https://cotlet.dev/use-cases.md) · [Security](https://cotlet.dev/security.md) · [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md) · [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [Contact](https://cotlet.dev/contact.md) · [Pricing](https://cotlet.dev/pricing.md) · [Sign up](https://cotlet.dev/signup)

# Add conditional logic and page branching to a Fillout form

> Show or hide questions and route respondents to different Fillout pages by their answers, set by your agent, from Claude Code, n8n or a script.

Source: https://cotlet.dev/integrations/fillout-api-mcp-server/add-form-logic

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.

[Sign up free](https://cotlet.dev/app/signup?app=fillout) [All Fillout tools](https://cotlet.dev/integrations/fillout-api-mcp-server.md)

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](https://www.fillout.com/help/conditional-hiding) · [Fillout Help: Form page logic](https://www.fillout.com/help/page-logic) · [Fillout Help: Build forms with Form Agent](https://www.fillout.com/help/form-agent) · [Fillout Help: Restore previous form version](https://www.fillout.com/help/restore-previous-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](https://cotlet.dev/integrations/fillout-api-mcp-server.md#automations)

## 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](https://cotlet.dev/integrations/fillout-api-mcp-server.md#tools)

## 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.

## More Fillout automations

- [Build a Fillout form from a brief](https://cotlet.dev/integrations/fillout-api-mcp-server/build-form-from-brief.md)
- [Close a Fillout form on a date or after a response limit](https://cotlet.dev/integrations/fillout-api-mcp-server/close-form-after-deadline.md)
- [Fillout API and MCP server: every tool](https://cotlet.dev/integrations/fillout-api-mcp-server.md)
- [All use cases](https://cotlet.dev/use-cases.md)

## 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.

[Sign up free](https://cotlet.dev/app/signup?app=fillout)

---

Give your AI agents your signed-in browser.

**Product:** [Integrations](https://cotlet.dev/integrations.md) · [Use cases](https://cotlet.dev/use-cases.md) · [How it works](https://cotlet.dev/how-it-works.md) · [Pricing](https://cotlet.dev/pricing.md) · [Security](https://cotlet.dev/security.md)

**Resources:** [Blog](https://cotlet.dev/blog.md) · [API docs](https://cotlet.dev/docs.md) · [Help center](https://cotlet.dev/help.md) · [Changelog](https://cotlet.dev/changelog.md) · [GitHub](https://github.com/cotletdev/cotlet)

**Solutions:** [For developers](https://cotlet.dev/for-developers.md) · [For automation agencies](https://cotlet.dev/for-agencies.md)

**Company:** [About](https://cotlet.dev/about.md) · [AI info: company facts](https://cotlet.dev/ai-info.md) · [Contact](https://cotlet.dev/contact.md)

**Legal:** [Terms of service](https://cotlet.dev/terms) · [Privacy policy](https://cotlet.dev/privacy) · [Refund policy](https://cotlet.dev/refunds) · [Acceptable use](https://cotlet.dev/acceptable-use) · [Cookie policy](https://cotlet.dev/cookies) · [DPA](https://cotlet.dev/dpa) · [Subprocessors](https://cotlet.dev/subprocessors)

**Elsewhere:** [Status page](https://status.cotlet.dev) · [Cotlet on GitHub](https://github.com/cotletdev) · [Cotlet on X](https://x.com/cotletdev) · [Cotlet on LinkedIn](https://www.linkedin.com/company/cotletdev) · [Cotlet on Product Hunt](https://www.producthunt.com/products/cotlet) · [Cotlet on Crunchbase](https://www.crunchbase.com/organization/cotlet) · [Cotlet on SaaSHub](https://www.saashub.com/cotlet)

Cotlet is an independent service. It is not affiliated with, endorsed by or sponsored by any of the products listed on this site. Product names are trademarks of their respective owners.

## For AI agents: sign your user up

Is your user asking you to sign them up for Cotlet? You can do it for them, no account or key needed.

1. Read the fields and their allowed values: GET https://cotlet.dev/api/v1/access-requests
2. Ask the user for each value: email, apps, what you will do with them. If they leave the password to you, generate a strong one and show it to them.
3. Show the user what you will send, then POST it as JSON to https://cotlet.dev/api/v1/access-requests.

One call creates the account and sends the access request; we email the user when access is granted.
