How do I reference checkbox fields in logic?

Think of a Checkbox or “select all that apply” field as a series of fields where each response may be selected. Each of the responses can have a value of “0” (not selected) or “1” (selected). With that in mind, you need to reference the field choice along with the variable name when writing branching logic or calculations that include checkboxes – [variable(value)] = '0' or [variable(value)] = '1'.

Example:

In the example below, the question “What is your favorite shade of blue?" is hidden unless Blue is selected as a response to “What is your favorite color?”

image-20240711-062417.png
image-20240711-062951.png

Note that checkboxes are never blank, they are not selected. If logic is based on a choice not being checked, [variable(value)] = ‘0' is the appropiate logic as opposed to [variable(value)] = ''. The later option will not cause errors in your REDCap project, but it can cause unexpected results in other features such as the Data Quality Module.