Multiple Checkboxes

From AgileApps Support Wiki
Revision as of 23:47, 2 April 2014 by imported>Aeric

Multiple Checkboxes provide options in a field to make multiple selections. Checked boxes have a value of "Yes/True" and unchecked boxes are "No/False"

To create values in a Multiple Check Box:

  1. See the instructions to add a Field
  2. Select the Multiple Check Boxes display type
  3. Enter each value on a new line; In this example, shoe sizes are listed:
    Multicheckbox.gif

In the record, the Multiple Check Boxes will appear as follows:

Multicheckbox-ui.gif

Although the labels for the enumerated values may contain commas, the enumerated values may not contain commas

The orientation can be vertical or horizontal

  • When displayed vertically, each label is shown on a separate line
  • When displayed horizontally, the labels are shown on the same line, separated by commas

For Multiple Check Box fields where the labels include commas, vertical orientation is the better choice.


Considerations
  • The value stored in the database is a comma-separated list of labels, one for each selection. So:
  • If you change the order of the values, new values may be stored differently than old ones.
  • To avoid a Data Truncation Error at runtime, make sure the field is large enough to contain all possible selections.
  • Calculate the size as the sum of the entry lengths, plus N-1 for the commas between them, where N is the number of entries.
  • To test for a checkbox selection in a Rule condition, use {fieldName} contains {checkboxLabel}
(Single quotes are automatically added around the label to create a valid expression.)
  • The easiest way to change the value of the field (for example) is to assign it a value that is a comma-separated list of checkbox labels. For example: 'Apples,Oranges,Bananas", where "Apples" is the label for the first checkbox, and so on.
  • Use an expression like this one to mark a single box in a Rule action:
IF( ISNULL(field), 'checkboxLabel', field+', checkboxLabel')
  • If the field is empty, the label is assigned to it. If the field has a value, the checkbox label is appended to it.
  • The checkbox label is case-sensitive, and must match the configured value exactly.
  • Spaces are allowed between items in the value-list (but be sure to size the field appropriately.)
  • To uncheck a box in a rule, you need one of two expressions:
REPLACE(field, ', checkboxlabel', '') - for multiple selections, or
REPLACE(field, 'checkboxLabel', '') - for a single selection
The expressions then need to be placed inside of a nested IF statement to see if either one applies:
IF (CONTAINS(field, ', checkboxLabel'), -first replacement-,
IF (CONTAINS(field, 'checkboxLabel'), -second replacement-, field) )
  • This expression does the appropriate substitutions of the label is present. Otherwise, it returns the original field.