For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

  1. 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

  2. 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

  1. In Designer, navigate to Visual Components > Forms

  2. Create a new assessment or edit an existing one

  3. Add the CDTs and fields you created above to the form

  4. Arrange them in logical order

  5. Save the form (don't publish yet)

Step 3: Add Conditional Logic to the Assessment

  1. In the form editor, locate the Conditional Logic section or Form Rules

  2. 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

  1. 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

  2. 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

  3. 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

  4. 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

  5. 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

  1. Create a Test Assessment Instance – As if completing the form

  2. 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

  3. Test Edge Cases:

    • Empty fields (if condition references empty field)

    • Multiple selections (if using Multi-Select)

    • Numeric boundaries (if using numeric operators)

After Publishing

  1. Have care team members test in Care app

  2. Have patients complete via PFA link

  3. Verify conditional fields appear/disappear as expected

  4. 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

  1. Group Related Questions – Keep trigger and conditional fields close together on form

  2. Clear Labeling – Use clear question text that explains why conditionals appear

  3. Avoid Complex Nesting – Keep conditional logic simple when possible

  4. Test Thoroughly – Test every conditional path before deployment

  5. Document Logic – Include notes explaining why conditions exist

  6. Consider User Experience – Don't overuse conditionals; can confuse users if overdone

  7. Mobile Testing – Test conditionals on mobile devices for responsive behavior

  8. 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

Last updated

Was this helpful?