Product EngineeringFeaturesLab FormsFrontendcrelio-app

Skip Logic & Conditionals

Two-layer conditional rendering and skip-to navigation in the patient UI.

👤 Ritu Kataria📅 Updated: Mar 13, 2026🏷️ feature

Skip Logic & Conditional Rendering

The patient UI implements a two-layer conditional system: field-level depends_on visibility conditions and process-level skip_to_conditions navigation.


Layer 1 — Field-Level depends_on

Evaluated in formUtils.ts. Controls whether individual fields are visible or editable based on another field's value.

Configuration on a field:

{
  "depends_on": ["fieldId", "operator", "valueToCompare"]
}

Supported operators:

OperatorDescription
=Equals
!=Not equals
>, <, >=, <=Numeric comparisons
inValue is in a set
not inValue is not in a set
anyAny of the provided values match
allAll of the provided values match
  • If condition fails → field hidden = true
  • read_only_depends_on controls disabled state using the same operator set

Layer 2 — Process-Level skip_to_conditions

Evaluated in patientConsent.tsx. Controls navigation between processes and subprocesses based on a question's answer.

Enabled by: allow_skipping = true on the question.

After a field value changes, afterFieldOnChange() checks the question's skip_to_conditions for a matching value → answer mapping.

Skip Actions (skip_to_type):

ActionBehaviour
"Process"jumpToProcess(skip_to) — jump to another process by ID
"SubProcess"jumpToSubProcess(skip_to) — jump to a specific subprocess
"End Process"nextProcess() — advance to the next process in order
"Abort Process"jumpToEndProcess() — jump to the Close Down process
"End Process & Restart"Clear values and restart from the parent process
"End Process & Resume"Resume the parent process where it was left off

Value operations on skip:

OperationBehaviour
"iterate"Save current values as a completed iteration (stacked in iterationValues)
"reset"Clear current form values

Confirmation Before Skip

If requires_confirmation_message === "True" on a question:

  1. afterFieldOnChange() intercepts the skip
  2. Shows a confirmation modal with the configured message
  3. Confirm → execute the skip
  4. Cancel → revert the field value, suppress the skip

On this page