formbasedocs
Go to appApp

Building Forms

Conditional logic

Logic blocks react to what a respondent enters — show or hide any block, jump to pages, block submission, or calculate values. Layer simple rules into sophisticated branching without code.


What logic can do

Every logic block has one or more rules. Each rule pairs a condition group (when should this fire?) with one or more actions (what should happen?). Nine action types are available:

ActionWhat it does
ShowReveal a hidden block — a question, paragraph, image, or option — when conditions match.
HideConceal a visible block — a question, paragraph, image, or option — when conditions match.
Make requiredDynamically require a field for certain paths.
Make optionalRelax validation on a required field when conditions match.
Set next pageSkip to a specific page — this is how you build branching
Calculate valueCompute totals, scores, or pricing from other answers.
Set payment amountSet, increase, or decrease a Payment field price based on answers.
Prevent navigation to next pageStop the respondent from advancing, with an optional message saying why.
Prevent submit formPrevent submission until conditions are met (e.g. terms accepted), with an optional message saying why.

Adding a logic block

A logic block is a document element — it sits on the canvas between questions, just like a heading or an image. You can place it anywhere: between two fields on the same page, at the top of a page, or right before a page break.

  1. 1

    Open the slash menu

    Click an empty line on the canvas and type /. The block picker appears.

  2. 2

    Search for "Logic"

    Type logic to filter. Pick Logic from the Layout category. A new logic block appears at the cursor.

  3. 3

    Add a rule

    The block reads When … Do …. Each rule has one condition group and one or more actions.

  4. 4

    Define conditions

    Pick a field, choose an operator, and set a value. Add another condition, or add a set of conditions to nest one level deeper.

  5. 5

    Choose actions

    Pick an action type (Show, Hide, Make required, Set next page, and so on) and choose the target — a question, a block, an option, or a page.

  6. 6

    Add more rules (optional)

    A single logic block can hold multiple rules. Each rule is independent: its own conditions, its own actions.

Conditions

Conditions are the When side of a rule. Each condition picks a field, applies an operator, and often compares against a value. The field picker groups what you can watch: Questions, Hidden Fields, Calculated Fields, and Metadata (today, the respondent’s locale).

All or Any

Once a rule has two or more conditions, a toggle appears at the top of the When section:

  • All — every condition must be true for the rule to fire. The rows read “and”.

  • Any — one true condition is enough. The rows read “or”.

Sets of conditions

Add a set of conditions nests a second group inside the first, one level deep, with its own All/Any toggle. That covers compound logic like “plan is Pro and (country is Norway or country is Sweden)”. A set holds conditions only — it cannot hold another set.

Keep it readable

If a single logic block feels too complex, consider splitting the logic across multiple logic blocks or restructuring your form pages.

Operators reference

The operator list is decided by the field you picked — you only ever see the ones that field supports. Below, each heading names the exact set.

Text (Text Input, Text Area, and text calculated fields)

OperatorDescription
isValue matches, ignoring letter case and surrounding spaces
is notValue does not match
containsValue includes the specified text
does not containValue does not include the specified text
starts withValue begins with the specified text
ends withValue ends with the specified text
is emptyField has no value
is not emptyField has any value

Every text comparison ignores letter case and spaces at either end, so x@Competitor.com ends with @competitor.com.

The other text-like inputs carry a narrower set, so pick the type that matches how you need to compare:

FieldOperators it offers
Emailcontains, does not contain, is, ends with, is empty, is not empty
Website URLcontains, does not contain, is, starts with, ends with, is empty, is not empty
Phone Numberis, starts with, contains, is empty, is not empty
Hidden field (text)The full text set above

Numeric (Number, Star Rating, linear scale, numeric hidden and calculated fields)

OperatorDescription
isValue matches exactly
is notValue does not match
is greater thanValue is above the specified number
is less thanValue is below the specified number
is greater than or equal toValue is at or above the specified number
is less than or equal toValue is at or below the specified number
is betweenValue falls within a range (inclusive)
is emptyField has no value
is not emptyField has any value

Checkboxes and picture choice

OperatorDescription
has checked any ofAt least one of the specified options is checked
has not checked any ofNone of the specified options are checked
has checked all ofEvery one of the specified options is checked
has checked exactlyChecked options match the specified set exactly
is emptyNo options are selected
is not emptyAt least one option is selected
OperatorDescription
isSelected option matches exactly
is notSelected option does not match
is emptyNothing selected
is not emptyAn option is selected

Toggle Switch (and boolean calculated fields)

OperatorDescription
is onThe toggle is switched on
is offThe toggle is switched off

Signature

OperatorDescription
is signedA signature has been drawn
is not signedNo signature has been drawn

File Upload

OperatorDescription
has fileAt least one file has been uploaded
has no fileNo file has been uploaded

Date Picker and Time Picker

OperatorDescription
isExact match
is notDoes not match
is beforeBefore the specified date/time
is afterAfter the specified date/time
is betweenFalls within a date/time range
is emptyNo value selected
is not emptyHas a value

Ranking

OperatorDescription
option is ranked firstThe specified option is in the first position
option is ranked lastThe specified option is in the last position
option is ranked aboveThe specified option is ranked above another option

Matrix / Grid

OperatorDescription
row answer isA specific row has the specified answer
row answer is notA specific row does not have the specified answer
row is answeredA specific row has been answered
row is not answeredA specific row has not been answered

Payment

OperatorDescription
amount equalsThe payment amount matches exactly
amount is greater thanThe payment amount is above the specified value
amount is less thanThe payment amount is below the specified value
is completedPayment was successfully processed
is not completedPayment has not been processed yet

Fields you cannot watch

Schedule appointment and Documents can be visibility targets but never condition sources. A booking is attached to the submission rather than stored as an ordinary answer, and a Documents block collects no answer at all. Use earlier qualification answers to show or hide either one. Every visible Schedule appointment question must be booked before submission; a hidden one does not block it. See Cal.com scheduling with logic.

Targeting

Each action needs a target — the thing it acts on. The target depends on the action type:

Action typeTargetExample
Show / HideAny block — a question, paragraph, image, layout container, or a specific option within a choice fieldShow a "Good choice!" paragraph when an option is picked
Make required / Make optionalA questionRequire "Dietary restrictions" only for in-person attendees
Set next pageA pageSkip to page 5 for returning customers
Calculate valueA calculated fieldSum three Star Rating scores into a total
Set payment amountA Payment fieldIncrease the price by 15 when "Rush delivery" is on
Prevent navigation to next page / Prevent submit formNo target needed (only the message)Prevent submission until terms toggle is on

Show and Hide reach beyond questions. Target any block on the canvas — a paragraph, heading, image, or layout container — to reveal a note that was hidden by default, or hide content once it is no longer relevant. They can also target individual options inside a choice field, not just the whole question. Hide a block from the block menu first, then write a rule to reveal it.

How multiple rules combine

Every rule is independent, and they all evaluate together. Rules are read top to bottom, across logic blocks, in document order. How several rules on one target combine depends on the action.

ActionHow several rules combine
Show / Hide, Make required / Make optionalOnly a rule whose conditions match claims the target, so rules stack as an or: the block is shown if any matching rule shows it. A rule that does not match applies its opposite but claims nothing, so a later matching rule still wins.
Set next pageA jump acts when the respondent presses Next on the page with the questions it reads, and on no other page. Of the rules that act there, the first that matches wins. A rule that reads only hidden or calculated fields acts on any page, but only jumps forward.
Calculate valueEvery matching rule runs, in order, on the running value. Nothing claims anything.
Set payment amountOnly a "set to" rule whose conditions match claims the price, so the first matching one owns it and a list of "set to" rules can price each tier. "increase by" and "decrease by" never claim — they stack in order on the running amount.
No rule matchesThe block returns to its default — hidden if it was hidden by default, visible otherwise.

So you can point several rules at one block without them fighting. A feedback form has a Radio Buttons question — “What can we help you with?” — with four options, and a “Can we contact you?” email field hidden by default. Four rules each Show that same email field (plus their own follow-up question) for their option. The email field appears no matter which option is picked, and stays hidden only if none is.

Often one rule is enough

To reveal a block for several answers, one rule with Any and a condition per answer — or a single is not empty condition to cover them all — is easier to read than four rules. Reach for several rules when each option also needs its own distinct follow-up.

Conflicting rules

When two rules disagree on the same target — one Shows a block while another Hides it, or one makes a field required while another makes it optional — and both conditions match at once, the first rule wins. The later, losing rule is flagged in the editor: “This action never applies — an earlier rule already controls its target. Rule order decides: the first rule wins.”

One ordering exception: a rule whose condition reads a calculated field runs after the rule that writes it, whatever the document order, so a score is always computed before anything branches on it. Rules that write each other’s calculated fields in a loop raise a publish warning that names the chain — break the loop so values resolve predictably.

Hidden beats required

A question that ends up hidden is never required, whether it was hidden by a rule or hidden from the block menu with no rule to reveal it. The asterisk disappears and submission is not blocked — otherwise a respondent could be locked out of a form by a field they cannot see.

Common patterns

Show a follow-up question based on a previous answer

A satisfaction survey asks “How would you rate your experience?” with a 1-5 Star Rating. A logic block below it uses the condition “rating is less than or equal to 3” with the action Show targeting a Text Area field that asks “What could we improve?” Respondents who rate 4 or 5 never see the follow-up.

Reveal a message when an option is picked

A signup form has a Radio Buttons question: “Which plan fits you best?” Below it sits a paragraph — “Good choice! Our Pro plan includes priority support.” — hidden by default with the block menu’s Hide. A logic block reveals it: if plan is “Pro”, Show the paragraph. The encouraging note appears only for Pro pickers, and stays hidden for everyone else.

Branch to different pages based on a selection

An event registration form has a Radio Buttons question: “Are you attending in person or remotely?” Two logic blocks follow:

  • Rule 1 — condition: attendance is “In person”, action: Set next page “Venue details”.

  • Rule 2 — condition: attendance is “Remote”, action: Set next page “Streaming setup”.

  • Rule 3 — condition: arrival time is not empty, action: Set next page “Confirmation”. Arrival time is a required question on “Venue details”.

Rules 1 and 2 read the attendance question, so they act when the respondent leaves its page. After that, Next goes on in page order. Rule 3 reads a question on “Venue details”, so it acts when the respondent leaves that page. In-person attendees then skip “Streaming setup”. Each path collects only relevant information, then both converge on a shared “Confirmation” page.

Calculate a score and branch on it

A lead-qualification form has three Star Rating questions: budget, timeline, and authority. A calculated field named “Lead score” uses a logic block with the Calculate value action to add the value of each rating. A second logic block reads the calculated field: if Lead score is greater than 12, Set next page “Priority follow-up”; otherwise jump to the standard confirmation page.

React to a hidden field value

The URL populates a hidden field named plan (e.g. ?plan=enterprise). A logic block checks: if plan is “enterprise”, Show the “Dedicated account manager” question and Make required the “Company size” field. Free-tier respondents never see these questions.

Gate submission on a calculated total

An order form calculates a running total. A logic block uses the condition: if Order total is less than 10, Prevent submit form. The respondent cannot submit until the minimum order threshold is met.

While a prevent rule is active, the button reads as unavailable and the respondent is told why. Type the reason into Message shown to respondent on the action row — “Your order must total at least 10” — so they know which answer to change. Leave it empty and the form falls back to “This form cannot be submitted with the current answers.” (or “You cannot continue to the next page with the current answers.” for a navigation block). When several prevent rules fire at once, the first one that carries a message supplies the wording.

Test logic with Preview

After setting up your rules, switch to Preview in the top toolbar and fill out the form as a respondent would. Logic fires in real time in Preview, so you can verify every branch, hidden field, and validation gate before publishing.

Next steps