Option fields allow people to choose an answer to a question from a pre-defined list of possible options. When you build a form that has an option field, you define what the possible answers are by choosing a specific type of option field or by customizing the option list using the Options tab.
This article covers the following topics:
- Types of option fields.
- Ordering the option list.
- Scoring your options.
- Steps to create an option field.
- Setting up conditional options.
- Configuring importance indicators.
- Changing the options in a live form.
Types of option fields
There are nine option fields types:
- Single selection: allows the user to pick one option from a vertical or horizontal list of customizable question answers in the form of radio buttons.
- Tick: allows the user to tick a box or leave it empty. The unticked state is always associated with the first option on the list and the ticked state with the second option.
- Dropdown: allows the user to pick one option from a drop-down list of customizable question answers.
- Multiple selection: allows the user to pick multiple options from a vertical list of customizable question answers in the form of tick boxes.
- Search list: allows the user to pick one option from a hidden, customizable, list by entering text and picking a matching option.
- Slider: allows the user to pick one option from a horizontal sliding scale. The options visible underneath the slider can be limited via the slider options display property, which can help with neatly displaying a slider with a lot of options. You can choose to show all, alternating, first and last, or first, middle and last options.
- Rating: allows the user to pick from a specified number of stars. Note that options and scores cannot be assigned to each star; instead, each is automatically assigned a number from left to right (e.g. the third star will return a numerical score of three).
- True/false: allows the user to choose True or False.
- Yes/no: allows the user to choose Yes or No.
Note that Database fields can also be thought of as a type of option field.
We recommend that you avoid using True/false and Yes/no fields in favor of Single selection or Dropdown fields so that you can update the option list if required. If you want to change or add options for a True/false or Yes/no field, you would need to change the field type, which means exporting the data and re-importing it to the updated form.
Ordering the option list
It's important to keep in mind that the ordering of the option list affects the sorting behavior when people click the column headers in reports, Embedded reports, Embedded events, front page reports or the Performance history. In each of these areas, the data will be sorted according to the option list order.
If the Best Value advanced property has been set, then this will also affect the sorting order based on which field has been selected as the best option and the direction of the scoring.
Scoring your options
If you want to write calculations about the data collected using an option field, it's important to score the contents of the option list, which you can do from the Scoring tab.
If an option field has scores assigned, a calculation referencing that field will return the score assigned to the selected option, rather than the option itself. If you want your calculation to return the option instead, you can use the option() function.
For example, a Wellness form may have a field called Fatigue with the following options and associated scores:
- Extremely fatigued (assigned a score of 1).
- Very fatigued (assigned a score of 2).
- Moderately fatigued (assigned a score of 3).
- Slightly fatigued (assigned a score of 4).
- No fatigue (assigned a score of 5).
Then using a separate calculation, you could either:
- Return the score (in a simple calculation) with the following formula:
- Return the option (in a text or option calculation) with the following formula:
When referencing an option field with scores in a dashboard widget, the widget will reference the option names for the field, instead of the scores. In order to display the option scores (e.g. in a Time series chart or a Tile), follow the instructions above to create a simple calculation to return the score and use this calculation field in the dashboard.
Steps to create an option field
- Within a form in the builder interface, select an option field from the sidebar.
- Provide a unique Name for the field.
- Use the Options tab in the sidebar to customize the list of possible options.
- Insert each option on a new line.
- Use the Update button to confirm your list.
- Use the Scoring tab to assign a value to each option, if required. Provide a score for all options and use the Update button to confirm your selections.
If you need to remove all scores, use the Clear all button.
Setting up conditional options
When you have more than one option field in a form, you can choose to make the option list of one option field dependent on the answer given in another option field. This is called a conditional option and requires two settings:
- The Conditional option advanced property of the filtered field is set to the name of the filtering field.
- The option list of the filtered field needs to be set up in a specific way.
In the option list for the filtered field, the options from the filtering field must be listed and followed by a colon, then the relevant options for each filtered field should be listed underneath.
In this example, we have two dropdown fields - one for sport and one for position. The choice of position is dependent on which sport is selected, so we've set up the option list of each field as follows:
|Options for the Sport field||Options for the Position field|
Notice that some options appear twice in the option list (such as Fullback and Hooker). Smartabase will treat these options as the same value for sorting purposes.
Configuring importance indicators
In some instances, option fields can be used to mark other fields in a form as Important and to be summarized in an Important summary field. This is a useful way to display a summary of data from specified fields within a form. In order to populate the Important summary field, other fields in the form must be configured in the advanced properties as importance indicators. There are two ways to configure importance indicators:
Both of these methods can be used in the same form to populate the Important summary field.
Using a Tick field
For this method, fields must be arranged in columns and there must be a Tick field in each row. The position of the Tick field within the row does not matter. Any fields in the same row as a checked Tick field are included in the Important summary field.
When configuring the options for a Tick field, the first option will be the default so this should be either empty, No, N or something similar to indicate non-importance. The second option should be Yes, Y, Important or something similar to indicate importance. Do not assign any scores to the options in the Scoring tab.
The final critical step is to set the Importance selector advanced field property for the field to Yes.
In the musculoskeletal screening example above, the Important fields in the far right column have been configured as importance indicators. The Tick field in the same row as Foot/Toes has been checked and, as a result, the Foot/Toes and Details fields have been summarized in the Important summary field (Summary). The Important field in the first row has not been ticked so the fields in that row have not been included in the summary.
Using an option field where a single response is selected
This method requires specific scoring for each option in the option field. If other scores are needed due to the form requirements and they do not meet the criteria specified below, you should use the tick box method outlined previously.
For this method, other option field types can be used to indicate importance as long as:
- Only one option can be selected, and
- A score can be assigned to all options.
Fields that meet this criteria include Single selection, Dropdown, Search list and Slider fields.
In the musculoskeletal screening example above, the Leg/Ankle and Foot/Toes fields have been configured as importance indicators when Abnormal is selected. Because Abnormal has been selected for Foot/Toes, the values from this row appear in the Important summary field.
As with the previous method, the option field must be set up with two options to mark the row as either important or not important and the Importance selector advanced field property must be set to Yes. However, in contrast to a Tick field, scores must be set for all options where a score of 1 or greater will pull the field through to the Important summary field and a score of 0 will not.
Changing the options for a form with data recorded in it
There is a special migration process for modifying the option list once a form is in use. You can use the option migration process to convert the name of an option to another name, remove an option or make two options the same.
The option migration feature is found on the event form page (or the profile form page, if you're modifying an option field in a profile form).
In this example, we want to change the name of a sport from Soccer to Association football, so we've entered the new option name and left the rest of the options the same. Once the Migrate button is used, Smartabase will update all historical records for this form with the new option value. When people use this form in the future, they'll see Association football on the dropdown list for the Sport field instead of Soccer.
If you are migrating the name of an option used as a filtering field for another option field (as in the example shown above), you will need to manually update the option list of that field to use the new option name.
When you migrate an option field, you should wait for the notification email from Smartabase which lets you know the migration is complete before doing any other migrations or resaves.
It's also critical that you refresh your browser session before re-opening a form that you've just completed a migration on. If you don't refresh your browser, you'll be shown the pre-migration version of the form. This can lead to inadvertently causing data loss if you then save the old version of the form after a new one has been created by the migration process.