Simulating Dynamic Dropdowns in REDCap

It's important to note that REDCap focuses on Branching Logic, which means hiding or showing entire fields based on previous answers. It doesn't directly support dynamically changing the options list within a single dropdown based on a prior selection (which is often what people mean by "dynamic dropdown").

However, we can use branching logic to simulate this effect by creating multiple fields and showing only the relevant one.

Goal: We want to ask for a specific US State only if the user selects "USA" as their country.

Concept: We will have one field for the country and another field for the US state. The US state field will only appear if "USA" is selected in the country field.


Tutorial: Simulating a Dynamic Choice Using Branching Logic

This tutorial shows how to make a field (like a state dropdown) appear only when a specific option (like "USA") is chosen in a previous field (like a country dropdown).

1
Create the 'Trigger' Field (e.g., Country)
  1. In the REDCap Online Designer, add a new field.
  2. Field Type: Choose "Dropdown List" or "Radio Buttons".
  3. Field Label: Enter something like "Country".
  4. Variable Name: Give it a name, e.g., country.
  5. Choices: Define your options, making sure to note the coded numerical values. For example:
    1, USA
    2, Canada
    3, Mexico
    (Here, "USA" is coded as 1).
  6. Save the field.
2
Create the 'Conditional' Field (e.g., US State)
  1. Add another new field after the country field.
  2. Field Type: Choose "Dropdown List".
  3. Field Label: Enter something like "US State".
  4. Variable Name: Give it a name, e.g., us_state.
  5. Choices: Enter the list of US states (e.g., AL, Alabama | AK, Alaska | AZ, Arizona ...). The codes here don't affect the logic itself, just data storage.
  6. Do NOT save yet.
3
Apply Branching Logic to the Conditional Field
  1. While still editing the us_state field (Step 2), find the Branching Logic section. Click the green double arrow icon () next to it.
  2. A pop-up window ("Add/Edit Branching Logic") will appear.
  3. You can use either the "Drag-N-Drop Logic Builder" or the "Advanced Branching Logic Syntax". For this simple case, Advanced is easy.
  4. In the "Show the field ONLY if..." text box, type the following logic:
    [country] = "1"
    • [country] is the variable name of your trigger field (Step 1), surrounded by square brackets.
    • = is the comparison operator (equals).
    • "1" is the coded numerical value for "USA" from Step 1, surrounded by quotes.
  5. Syntax Check: REDCap should automatically check your syntax. If it's correct, you'll see a green "✔ Valid" message.
  6. Click Save in the pop-up window.
  7. Now click Save for the us_state field itself.

How it Works:

Extending the Simulation:

If you wanted to ask for Canadian Provinces if "Canada" was selected, you would:

  1. Create another field called ca_province (Dropdown with provinces).
  2. Apply branching logic to ca_province: [country] = "2"

This way, only the relevant follow-up question appears based on the country selection.