Option fields allow people to choose an answer to a question from a pre-defined list of possible answers. 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.
There are nine option fields types:
- True/false: allows the user to choose True or False.
- Yes/no: allows the user to choose Yes or No.
- 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).
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, because single selection and dropdown fields let you update the option list. If you want to change or add options for a true/false or yes/no field, you would be required to change the field type, which means exporting the data and re-importing it to the updated form.
Steps to create an option field in an event form
- Log in to the builder interface.
- Select the Event Forms tool.
- Select New Event Form from the Options drop-down list.
- Name and categorize your event form.
- Choose an option field from the list of standard fields in the left sidebar.
- Name your new field.
- Use the Options tab of the field's properties 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.
- Save your new event form.
- Use the roles tool from within the administration homepage to update your data permissions in order to test this event 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, front page reports or the performance history tool. 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.
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 standard calculation) with the formula: Fatigue, or
- Return the option (in a text or option calculation) with the formula: option(Fatigue).
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 |
Rugby union Rugby league Soccer |
Rugby union: Loosehead prop Hooker Tighthead prop Number-4 lock Number-5 lock Blindside flanker Number-8 Openside flanker Scrum-half Fly-half Inside center Outside center Left-wing Right-wing Fullback Rugby league: Prop Hooker Second row Halfback Five-eighth Centre Wing Fullback Soccer: Forward Midfield Defender Goalkeeper |
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.
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.