Show when and Required when
Logic lives on each question and step: Show when (visibleWhen) and Required when (requiredWhen). Each holds a condition, written as JSON:
{ "kind": "field", "key": "company", "type": "text", "label": "Company", "visibleWhen": { "field": "contact_type", "op": "eq", "value": "business" }, "requiredWhen": { "field": "budget", "op": "in", "value": ["10k-25k", "25k-plus"] }}A step with visibleWhen is skipped when it’s false, which is how “skip to” works. Endings use when, and the first that matches is the thank-you that shows.
A condition
Section titled “A condition”type Condition = | { all: Condition[] } | { any: Condition[] } | { not: Condition } | { field: string; op: "answered" | "empty" } | { field: string; op: BinaryOp; value: string | number | boolean | string[] | [number, number] } | { variable: string; op: NumericOp; value: number | [number, number] } | { pricing: "subtotal" | "total" | "deposit"; op: NumericOp; value: number | [number, number] };{ "all": [ { "field": "service", "op": "includes", "value": "design" }, { "any": [ { "field": "budget", "op": "gte", "value": 10000 }, { "field": "rush", "op": "eq", "value": true } ] } ]}Operators
Section titled “Operators”| op | The answer… | Suits |
|---|---|---|
answered | has a value | any question |
empty | has no value, or isn't showing | any question |
eq | is | text, number, one choice, tick box |
neq | is answered and isn't | text, number, one choice, tick box |
in | is one of | text, one choice |
notIn | is answered and isn't one of | text, one choice |
includes | has this one picked | several choices |
excludes | is answered and doesn't have this one picked | several choices |
includesAny | has any of these picked | several choices |
includesAll | has all of these picked | several choices |
gt | is more than | number |
gte | is at least | number |
lt | is less than | number |
lte | is at most | number |
between | is between two numbers, inclusive | number |
before | is before | date or time |
after | is after | date or time |
on | is on | date or time |
contains | contains | text |
startsWith | starts with | text |
endsWith | ends with | text |
variable and pricing conditions take eq, neq, gt, gte, lt, lte and between. Text compares trimmed and ignoring case. Choices compare by option value. Dates can be relative (today, +7d), in the form’s time zone.
A blank answer
Section titled “A blank answer”A question that’s blank, hidden or on a skipped step makes every operator false, except empty. That includes neq, notIn and excludes.
{ "field": "topic", "op": "neq", "value": "sales" }is false while topic is blank. To include blank, say so with not:
{ "not": { "field": "topic", "op": "eq", "value": "sales" } }A tick box always has a value (false counts), and so does a quantity (its default, or min). So “not ticked” is { "field": "invite", "op": "eq", "value": false }.
What a condition can refer to
Section titled “What a condition can refer to”| Where it is | It can use |
|---|---|
A block’s visibleWhen |
anything before that block |
A question’s requiredWhen |
anything before it, and questions later in its own step |
A step’s visibleWhen |
earlier steps |
A step’s checks |
that step and earlier |
| Endings | anything, including the price |
Publishing refuses a form with a loop, or an operator that doesn’t suit its question.
ChatGPT is a trademark of OpenAI, and Claude and Claude Code are trademarks of Anthropic. Other product names and logos belong to their owners. None of them makes or endorses Seaforms. Trademarks