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 question, you define what the possible answers are by choosing a specific type of option field or by customising the option list using the Options tab.
Types of option questions
There are nine option question 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 customisable 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 customisable question answers.
- Multiple Selection: allows the user to pick multiple options from a vertical list of customisable question answers in the form of tick boxes.
- Search List: allows the user to pick one option from a hidden, customisable, 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).
Recommendations for option question choice
We recommend that you avoid using true / false and yes / no fields in favour 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 question, you would be required to change the field type, which means exporting the data and re-importing it to the updated form.
Create an event form that uses an option field
- Log in to the builder interface.
- Select the Event Forms tool.
- Select New Event Form from the Options drop-down list.
- Name and categorise your event form.
- Choose an option field from the list of standard questions.
- Name your new field.
- Use the Options tab of the field’s properties to customise 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 behaviour when people click the column headers in reports, embedded reports, front page reports or the 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 question 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 question dependent on the answer given in another option question. 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 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:
- Rugby union
- Rugby league
Options for the Position field:
- Rugby union:
- Loosehead prop
- Tighthead prop
- Number-4 lock
- Number-5 lock
- Blindside flanker
- Openside flanker
- Inside centre
- Outside centre
- Rugby league:
- Second row
In the option list for the filtered field, we’ve added the options from the filtering field followed by a colon and then the options that should appear.
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 question instead of Soccer.
Note that this is the same field used as part of the conditional option example shown above. If you are migrating the name of an option used as a filtering field for another option question, 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.