Yes, you can create automations based on checkbox fields in Castor EDC/CDMS using the Automation Engine.
Checkbox fields are fully supported as trigger conditions, allowing you to automatically perform actions such as hiding or showing forms/visits, creating queries, or sending survey invitations based on participant checkbox responses.
When you configure an automation condition based on a checkbox field under Study Field Value:
- Option selection (AND logic): If you select one option in the condition setup, the automation triggers when that option is checked. If you select multiple options in a single condition, all selected options must be checked simultaneously for the condition to be met.
-
Multiple distinct outcomes / OR logic: If you want an action to trigger when either option A OR option B is checked (or if different options trigger different actions), you have two options:
- Multiple automations: Create a separate automation rule for each specific checkbox selection.
- Calculation field helper: If you need complex conditional logic (e.g. trigger if option A is checked regardless of what else is checked), create an auxiliary calculation field that parses the checkbox string (using JavaScript string splitting) and use that calculation field's output as your automation condition.
Step-by-Step: Setting up an automation with a checkbox field
Make sure the Automation Engine is enabled for your study:
- Navigate to Settings > Study > Other.
- Select the checkbox for Enable the Automation Engine (or Enable beta features depending on your environment version) and click Save changes.
- The Automations tab will now be accessible under Settings (or Study).
1. Create a New Automation
- Navigate to the Automations tab.
- Click Add Automation in the bottom-right corner.
- Enter a clear, descriptive Name for your automation (e.g., "Hide follow-up form if No Complications checked").
2. Define the Event
- Under Event, select what initiates the check (typically Field Value Updated).
- Choose the specific checkbox field that should trigger the evaluation when data is entered.
3. Define the Condition
- Click Add Condition.
- Select Study Field Value from the condition list and click Next.
- Select your checkbox field from the form/visit list and click Select.
- In the value definition window, select the checkbox option(s) that must be ticked:
- Selecting a single option requires that specific option to be checked.
- Selecting multiple options requires all of those selected options to be checked at the same time.
- Click Save.
4. Select the Action
- Click Add Action.
- Choose the action you want executed when the condition is met:
- Show/Hide Form or Show/Hide Visit
- Add query
- Create and send a survey package invitation
- Select the target form, visit, or survey package.
- Click Save to complete the automation.
Advanced: Using a Calculation Field for Complex Checkbox Logic
Because Castor stores checkbox values as a semicolon-separated string (e.g. "1;2;4"), you can evaluate whether a specific box is ticked without requiring an exact match of all boxes:
-
Create a Calculation field with the template:
var selected = "{checkbox_variable}".split(';'); if (selected.indexOf("1") > -1) { 1; } else { 0; }(Replace
{checkbox_variable}with your field's variable name, and"1"with the option value you want to check). - Set your automation condition to trigger when the calculation field equals 1.
- You can set the calculation field to Hidden so it runs in the background without cluttering data entry.