Add Conditionality to Assessments
Overview
Welkin Health allows you to add conditional logic to assessments, enabling fields to be shown or hidden based on responses to other questions. Conditional fields improve user experience by displaying only relevant questions and reducing assessment length for users who don't meet certain criteria.
For example, you might show a "Please specify" text field only if a user selects "Other" from a list, or display allergy questions only if the patient answers "Yes" to having allergies.
Key Concepts
Conditional Statement – A rule that shows/hides a field based on another field's value
Trigger Field – The question whose response determines visibility
Conditional Field – The question that appears/disappears based on the trigger
Condition Logic – The rule that evaluates the trigger field (e.g., "equals Yes", "contains 'Other'")
Single CDT Conditions – Most common; conditions within one CDT
Multi-CDT Conditions – Advanced; conditions across multiple CDTs
Building Blocks for Conditionality
Step 1: Create CDTs and CDTFs for Your Questions
Before adding conditions, you need:
Trigger Field CDTF – The field whose response triggers the condition
Type: Usually "List" (single-select) or "Multi-Select List"
Options: Must include a value that will trigger the condition
Example: A "Yes/No" list field or "Other" option in a dropdown
Conditional Field CDTF – The field that appears when condition is met
Type: Can be any field type (text, numeric, date, etc.)
Example: "Please specify" text area field
Simple Example Structure:
Complex Example Structure:
Step 2: Create the Assessment/Form Template
In Designer, navigate to Visual Components > Forms
Create a new assessment or edit an existing one
Add the CDTs and fields you created above to the form
Arrange them in logical order
Save the form (don't publish yet)
Step 3: Add Conditional Logic to the Assessment
In the form editor, locate the Conditional Logic section or Form Rules
Look for a button like + Add Condition, Add Rule, or Conditional Logic
Creating a Condition
Basic Condition Structure
Most conditions follow this pattern:
Condition Configuration
Select the Trigger Field – Choose which field's response will trigger the condition
Typically a field that's already visible on the form
Usually a List or Multi-Select field
Select Condition Operator – Choose how to evaluate the trigger field:
Equals – Value exactly matches
Not Equals – Value does not match
Contains – Value includes specified text
Does Not Contain – Value does not include text
Greater Than – Value is numerically greater
Less Than – Value is numerically less
Is Empty – Field has no value
Is Not Empty – Field has a value
Enter the Condition Value – Specify what value triggers the condition:
Example: If operator is "Equals", enter the specific option (e.g., "Yes", "Other")
Example: If operator is "Contains", enter the substring to look for
Select Field to Show – Choose which field appears when condition is true:
This field will be hidden by default
It shows only when the condition is met
Save the Condition – Click Save or Add Condition
Practical Examples
Example 1: Show "Other, Please Specify" Field
Scenario: Employment status question with "Other" option that requires explanation
Trigger Field: employment_status (List: Employed/Unemployed/Self-Employed/Student/Other) Conditional Field: employment_status_other (Text: "Please describe your employment")
Condition Configuration:
Result:
Patient sees employment status dropdown
Selects "Other"
"Please describe your employment" field appears
Patient can now enter details
Example 2: Progressive Disclosure Based on Response
Scenario: Medication adherence assessment that asks follow-up questions only for non-adherent patients
Trigger Field: medication_adherence (List: Always/Most of the Time/Sometimes/Never) Conditional Fields:
adherence_barriers(Multi-Select: Cost/Forgetting/Side Effects/Other)adherence_interventions_needed(Text: "What would help you take your medications as prescribed?")
Condition Configuration:
Result:
Patients who always take medications see only one question
Patients with adherence issues see additional follow-up fields
Assessment is shorter and more relevant per patient response
Example 3: Condition with Empty Field Check
Scenario: Insurance information only relevant if patient has insurance
Trigger Field: has_insurance (List: Yes/No) Conditional Fields:
insurance_provider(Text)insurance_group_number(Text)insurance_member_id(Text)
Condition Configuration:
Result:
If "No": Insurance fields remain hidden
If "Yes": All three insurance fields appear
Example 4: Numeric Range Condition
Scenario: Show depression severity interventions only for elevated scores
Trigger Field: phq9_score (Integer: 0-27) Conditional Field: depression_interventions_recommended (Text)
Condition Configuration:
Result:
Score ≤ 10: No intervention field shown
Score > 10: Intervention recommendations field appears
Advanced Conditional Patterns
Multiple Conditions on One Field
Show a field when ANY of multiple conditions are true (OR logic):
Multiple Conditions (AND Logic)
Show a field only when ALL conditions are true:
Nested Conditions
Hide/show fields based on multiple levels:
Testing Conditional Logic
Before Publishing
Create a Test Assessment Instance – As if completing the form
Test Each Condition Path:
Select trigger value that shows conditional field → verify it appears
Select trigger value that hides conditional field → verify it disappears
Test every option in the trigger field
Test Edge Cases:
Empty fields (if condition references empty field)
Multiple selections (if using Multi-Select)
Numeric boundaries (if using numeric operators)
After Publishing
Have care team members test in Care app
Have patients complete via PFA link
Verify conditional fields appear/disappear as expected
Check that data is captured correctly when fields are hidden
Troubleshooting
Conditional Field Not Showing
Problem: Field should appear based on trigger value but doesn't
Solutions:
Verify trigger field value matches condition exactly (case-sensitive)
Check that conditional field is configured to show on the form
Ensure condition operator is correct (e.g., "Equals" vs "Contains")
Test with a different trigger value to isolate issue
Check browser developer console for JavaScript errors
Conditional Field Always Showing
Problem: Field is always visible regardless of trigger value
Solutions:
Check if field is set as "always visible" in form properties
Verify conditional logic was saved/published
Confirm trigger field hasn't been renamed or removed
Clear browser cache and reload
Multiple Conditions Not Working Together
Problem: Complex conditions with AND/OR logic not behaving correctly
Solutions:
Simplify conditions temporarily to test each separately
Verify AND/OR logic is configured correctly
Check parentheses or grouping of conditions
Test with different trigger values
Best Practices
Group Related Questions – Keep trigger and conditional fields close together on form
Clear Labeling – Use clear question text that explains why conditionals appear
Avoid Complex Nesting – Keep conditional logic simple when possible
Test Thoroughly – Test every conditional path before deployment
Document Logic – Include notes explaining why conditions exist
Consider User Experience – Don't overuse conditionals; can confuse users if overdone
Mobile Testing – Test conditionals on mobile devices for responsive behavior
Performance – Very complex conditional logic may slow form performance
Limitations
Conditions typically only reference fields within the same assessment form
Cross-assessment conditions (based on fields from different assessments) may not be supported
Conditional logic is evaluated client-side; complex calculations may not be possible
Some field types may not support conditions
Related Topics
How to Create an Assessment or Form Template – Form creation basics
Custom Data Types (CDT): Designer – Creating fields for conditions
Designer: How to Configure Scored Assessments – Assessment scoring with conditionals
Forms: Conditional Logic – Detailed conditional logic reference
How to Associate Assessments with Programs – Program-based assessment visibility
Last updated
Was this helpful?