Toggle menu

How Options Work

The checkbox group, drop-down, list box and radio group fields store their options an array of arrays. That is, a list like this:

[
    ["value 1", "display 1", "hint 1"],
    ["value 2", "display 2", "hint 2"]
]

Array Elements

Each option in a list-type field (ie each radio button, each checkbox, is option in a drop-down) is represented by an array. The array contains two or three elements: the value, the display, and either the group or the hint text.

Options will always have:

  • A value, which is what will be stored/saved when the form is submitted
  • A display value, which is the text that appears in the list, or next to the checkbox/radio button

Groups are used by drop-downs and list boxes to organise the options. If you don't have any groups, the options will be in a single list.

Hints can appear underneath checkboxes or radio buttons.

Arrays of Arrays

Because each option is an array, all of the options together are held in an array of arrays.

Example

For example, the options in the drop-down field:

List Options - Counties

Become:

COUNTY_OPTIONDATA = [
    ["", "Select County...", ""],
    ["Cornwall", "Cornwall", ""],
    ["Devon", "Devon", ""],
    ["Somerset", "Somerset", ""]
]

Note how the first array doesn't have a value (just empty quotes). This prevents the text "Select County" being picked as an option. None of the options are organised into groups.

Querying the Value

When you query the value that a user has picked from a list-type field using .queryFieldValue or the block:

Query Field Value

it's the value you'll get back, not the display element. Be careful of this if you are displaying the value back to the user in another field or display template.

Last modified on 12 May 2025