What this is, and who it is for
A form can react to what has been entered: a pregnancy question that appears only for women, a "specify" box that appears when Other is chosen, a checkbox ticked because a score crosses a threshold. The builder has three ways to do it, all built from the same condition:
| Tool | What it does |
|---|---|
| Visibility condition | Shows or hides a field, a section or a piece of static content |
| Value assignment | Sets a field's value when a condition holds |
| Auto-populate | Ticks or unticks a Checkbox or Toggle when conditions hold |
For a calculation use a formula; for something that must refuse or query across forms or visits use a rule. These tools work within one form.
Where to find it
Builder → select a field → Logic. Each tool is a card with a button that opens the condition builder (a dialog called Visibility Condition, Set to TRUE when and so on). A table row's visibility and a table column's N/A condition are set in the table's Rows and Columns (Tables and repeating groups).
What you can do
- Open Logic and choose Add visibility condition (or the tool you want).
- In the dialog choose ALL (AND) or ANY (OR) for the group, then Add condition for each test: pick a field, an operator and a value.
- Add group nests another AND/OR group inside, to any depth.
- Choose Apply logic. The dialog will not save a condition with no field, or with no value for an operator that needs one (N issues must be fixed before saving). Remove all logic clears it; Cancel leaves the field as it was.
Every option
Conditions
A condition compares one field with a value. A table cell can be the source (the cell of a named row and column, or, inside a table, the same row). The operators offered depend on the type of the field you choose:
| Field type | Operators offered |
|---|---|
| Number, Scale | equals (eq), does not equal (neq), greater than (gt), ≥ (gte), less than (lt), ≤ (lte), is empty (empty), is not empty (not_empty) |
| Date, Date & Time, Time | the same eight; dates and times are compared as points in time (08:05 and 8:05 are the same time, and 08:30 on 1 May is on 1 May) |
| Radio, Dropdown | equals, does not equal, is one of (in), is not one of (not_in), is empty, is not empty (the value is picked from the options) |
| Multi-Select | is one of, is not one of, is empty, is not empty. These are set tests: is one of A, B means at least one of A or B is selected |
| Checkbox, Toggle | equals, does not equal, is empty, is not empty |
| Text, Text Area, Email, Phone | equals, does not equal, contains (contains), starts with (starts_with), ends with (ends_with), is empty, is not empty (not case-sensitive for contains, starts with, ends with) |
| Range, File Upload | is empty, is not empty |
Two rules to remember: an empty field fails every test except is empty and is not empty (a comparison with something not yet entered is false, so a rule fires only on data that exists), and a condition cannot compare a field with another field, only with a value you type (the rules can).
- Adds one more test to the condition.
Visibility
A field with a visibility condition is shown only while the condition is true. While it is false the field is inactive: it stays on the page as a greyed placeholder, saying Not available based on current conditions or the Message when hidden you typed. Hiding a section hides everything inside it.
An inactive field is not validated (not even required) and does not count toward completion, in the browser and on the server, so a form with two complementary branches ("was it done? / if not, why not?") can always be completed. A field that is hidden in the builder with the field's own hidden flag is never shown to people entering data.
Value assignment
Offered for every data field except File Upload. A list of rules, each with an optional name, a condition and a value. They are tried in order and the first that matches wins; if none matches, the field keeps whatever was entered. The field is tagged Auto-assigned and cannot be typed over while a rule applies. Add rules with Add value rule; the value box fits the field (a list for a choice, a date picker for a date).
Auto-populate
For Checkbox and Toggle. Switch on Enable auto-populate, then define Set to TRUE when (required) and, if you wish, Set to FALSE when. The field is set to true when the TRUE condition holds and the FALSE one does not, and to false when the FALSE condition holds; when neither holds it is left as it was. A form with auto-populate on and no TRUE condition has an error in the issues list.
Circular logic
Logic that depends on itself (field A's visibility depends on B, and B's on A) is a circular dependency. Both fields are flagged as errors in the issues list, the form cannot be made active, and at run time the fields in the cycle are shown with no logic applied.
Mistakes the builder catches
A condition references a deleted field and references a field that is deprecated (a participant is served a form with that field removed, so the rule will never fire) are errors; so is a TRUE condition missing from an auto-populate.
What the system records
Conditions and rules are part of the form's design revision and snapshot. A value set by a rule is saved with the record like any other value, with the person who saved the form as its author; it is not marked as assigned in the audit trail. A field that was hidden when a form was saved holds whatever it held.
What you cannot do, and why
- Compare a field with another field in a form condition. Use a rule, or a formula.
- Make a hidden field required. A hidden field is not validated, by design.
- Rely on the server for value assignment or auto-populate. The server recalculates formulas and calculated table cells; it stores a value assigned by a rule or auto-populate as the browser sent it. A person using the API directly can store any value, subject to the field's checks.
- Change logic once the version leaves Build. It is frozen with the design.
Compliance Q&A
On the screen, yes: the field is tagged Auto-assigned (or Calculated for a formula) and cannot be typed over. In the audit trail the value is attributed to the person who saved the form.
Limits: the trail does not say the value came from a rule. For derived numbers prefer a formula, whose value the server recalculates and flags when it differs.
Evidence: client runtime/fields/RuntimeField.tsx (Auto-assigned tag)server save-responses (stores the value sent, attributed to the person saving)
Related
Field properties · Formulas and calculations · Tables and repeating groups · Rules reference · Preview and testing