|Best Practices | Choice Lists|
A choice list is a type of field that allows users to select from a pre-defined set of options. Administrators and users with the personalize_choices role can define the available options for choice lists. This article discusses best practices for setting up choice lists, including:
- Using only letters, numbers, and underscores in choice list options.
- Double-checking the Value field for special characters.
- Referencing choice lists for repetitive options.
Use these best practices for setting up and referencing choice lists to avoid issues and time in maintenance.
|Best Practice #1: Consider using only letter, numbers, and underscores in Choice list options.|
To set up a choice list for a Category field:
- Navigate to Incident > Create New.
- Right-click the Category label and select Personalize Choices.
- In the new item field, add [new_item] and press Enter. Avoid using spaces or other special characters.
- Click Save.
- To view, open the Category choice list and scroll down to the [new_item] created.
- Right-click the Category label and select Show Choice List.
When a new item is created, the system generates its Value field automatically from the Label field. Using special characters in the name, such as a space, can generate other characters, such as %, in the Value field. These characters can cause filtering issues, for example, when setting up a user interface (UI) policy to hide a Subcategory field.
|Best Practice #2: When adding an item to a choice list, show the choice list and make sure the Value field contains only letters, numbers, and underscores.|
If a special character is found in the Value field, rename the choice list item.
- Double-click [new%item] in the Value field.
- Change to [new_item] (or just a one-word item). Lowercase all letters for consistency with other items.
- Click Save.
|Best Practice #3: Reference choice lists for repetitive options.|
Referencing choice lists is a shortcut for implementing multiple, identical choice lists throughout an instance. For example, there may be 50 places where the same choice list is used. Rather than creating choice lists individually, create a choice list once, and then add it to other forms by referencing the original. Not only does this save time when creating choice lists, but it also simplifies choice list maintenance.
To customize the Category field from the incident form to the problem form:
- Open the Category list.
- Navigate to Problem > Create New.
- To add the Category field, right-click the form header, and select Personalize > Form Layout.
- Under the Create new field in the Name field, enter Category.
- For Type, select Choice.
- Click Add.
- In the Selected list, select Category and move up below the Work Notes list.
- Click Save.
Personalize the dictionary by pulling the choices from the incident table Category choice list:
- Click the Category list.
- Select Personalize Dictionary.
- For Choice table, select Incident.
- For Choice field, select Category.
- Click Update.
Any updates to the Category choice list on the incident form should automatically go to the Category choice list on the problem form.
For more information, see Customizing Choice Lists.