Checkbox Variable Functionality

Overview

This page describes the functionality of a checkbox variable type.

Required Role(s)

  • Project Management

Description

  • A Checkbox variable type ALWAYS contains a value (0 = Not Checked, 1 = Checked)
  • Typically a checkbox wouldn't be used for key outcome variables as 0/Not Checked can't be differentiated from a missed question
    • Checkboxes can reduce data entry burden as a 'No' response is the default and does not have to be selected
    • An alternative for a checkbox would be to use a radio button variable with pick list options of 0/No and 1/Yes, with this option No and missed have a different value
    • A use case for a checkbox would be to activate a skip pattern (e.g., Check the box to enter additional names)
  • Default attribute
    • The options for the default are:  null, 0, 1
    • 0: When the data entry form is opened, the checkbox is NOT checked.  If the checkbox variable is still not checked when the data entry form is saved, 0 is saved in the database.
    • 1:  When the data entry form is opened, the checkbox IS checked.  If the checkbox variable is un-checked when the data entry form is saved, a 0 is saved in the database
    • Null:  When the data entry form is opened, the checkbox is NOT checked.  If the checkbox variable is still not checked when the data entry form is saved, null is saved in the database.  This is used to avoid a change reason if the checkbox is subsequently marked.  A checkbox with a null value in the database means that it was never checked, however, when the data is exported, a value of 0 is exported (for a checkbox variable there are still only 2 states 0/not checked and 1/checked).  Once a checkbox with a 'null' default has been saved as checked, if it is subsequently unchecked, a 0 will be saved in the database.
  • The "Null" default is primarily used when Change Reason is enabled in the project and you do not want the change reason box to display the first time the checkbox is checked after the form has already been saved.
  • When using a checkbox variable as a condition in the dependency, the condition should either be 'equal to 1' or 'not equal to 1'
    • For example:
      • #DependentVar.show(#CheckboxVar == 1);
      • #DependentVar.hide(#CheckboxVar != 1);