View choice list definitions

The Choice Set [sys_choice_set] table contains a record for every field that uses a choice list.

Before you begin

Role required: personalize_choices

About this task

The choice set record is associated with an application file, which allows update sets and team development to track and transfer all choices for a field in a single update record.

Choice list values allow a maximum length of 40 characters.

Procedure

  1. Right-click the choice list field label and select Show Choice List.
    To view other choice list values, modify the filter at the top of the list.
  2. Review the items in the list.
    Warning: Do not add new choices to the list. To add new choices to a choice list field, use the Configure Choices option.

Define an option for a choice list

You can personalize the options that are available in a choice list.

Before you begin

Role required: personalize_choices

Procedure

  1. Navigate to a form where the field appears.
  2. If the choice list is dependent on another field, enter the choice value that the options depend on.

    For example, on the incident table, the Subcategory is dependent on the Category. To customize which subcategory choices are available for the hardware category, select Hardware in the Category field.

  3. Right-click the field label and select Configure Choices.
  4. Use the slushbucket to rearrange the order, add, or remove items or to create new items.
  5. Click Save.

    To dynamically add items to a choice list, use the addOption GlideForm method .

    Note: Some business rules may be affected by changes to choice list options (for example, default Incident states).

Reuse a choice list

After defining a set of choice list values, you can reuse the values for another field in a different table.

Before you begin

Role required: personalize_choices

Procedure

  1. Right-click an existing choice field (Field A) and select Configure Choices.
  2. Add the desired choice list values.
  3. To reuse the choice list values for another field (Field B) in a different table, right-click the label for Field B and select Configure Dictionary.
  4. In the Choice table field, select the table where Field A resides.
  5. In the Choice field field, select Field A.
    Choice list sharing
  6. Click Update.

    The choice list values defined on Field A are displayed on Field B. When you add or remove choice list values on Field A, those changes are also reflected on Field B. After you specify a choice table and a choice field, the field no longer uses the defined choice list.

Remove the None option from a choice list

You can remove the None option from a choice list if it is not necessary.

Before you begin

Role required: personalize_dictionary

Procedure

  1. Navigate to a form where the field appears.
  2. Right-click the field label and select Configure Dictionary.
  3. Change the Choice field value to Dropdown without -- None -- (must specify a default value).
    Choice without none
  4. Ensure that the Default field is populated to determine which choice is displayed by default.
    Note: If the field is dependent on another field, the -- None -- option remains available.

Change the None display value for a choice list

You can change the default display label of the None option for a choice field.

Before you begin

Role required: personalize_choices

Procedure

  1. Navigate to a form on which the field appears.
  2. Right-click the field label and select Show Choice List.
  3. Click New.
  4. Complete the form.
    Table 1. Choice form fields
    Field Value
    Table Select the table.
    Element Leave the name of the field that is automatically populated.
    Language Enter ISO language code for the label.
    Sequence Leave empty. This field determines the order.
    Inactive Leave cleared.
    Label

    Enter the label to appear in the choice list.

    You can use JavaScript, including calls to script includes, to define the label. For example, the JavaScript label in the following example changes the -- None -- value of the Time zone choice list in a user record to use the time zone value of the instance.

    New record creation
    Value Enter NULL_OVERRIDE.
    Note: You must enter NULL_OVERRIDE as the value, or the new label appears in addition to the -- None -- option.
    Dependent value Leave blank.
    Hint Leave blank.
  5. Click Submit.

Delete all choice list options

You can delete all choices for a choice field from the Choice Set record.

Before you begin

Role required: personalize

About this task

You may want to use this method when you are developing a new application and the business requirements change. If you are updating a choice list that is already in use, consider deactivating the options you no longer use to avoid conflicts with existing data or scripts that may rely on the previous options.

Procedure

  1. In the navigation filter, enter sys_choice_set.list and press Enter.
  2. Open the choice set record for the field.

    For example, to locate the choice set for the incident subcategory, filter by [Table] [is] [incident] AND [Element] [is] [subcategory].

  3. Check the box beside the choice set record to delete and select Delete from the Actions choice list below the list.
  4. Click Delete in the confirmation window.
    All choices for the field are deleted.

Create a choice list for another field type

You can create a choice list for a field with another type, such as an Integer field.

Before you begin

Role required: personalize_dictionary

About this task

You can use this configuration to standardize data entry and limit available options for a field while still maintaining the original field type.

Procedure

  1. Navigate to System Definition > Dictionary.
  2. Open the dictionary entry for the field.
  3. Change the Choice value to Dropdown with --- None --- or Dropdown without --- None --- (must specify a default value).
  4. Right-click the form header and select Save.
  5. Click Create Choice List.
    • The Choices related list appears on the dictionary entry form.
    • If records on the table contains data for the field, a choice list value for each unique field value is created. For example, if three records exist on the table and each record has a unique value in the field, then three choices are created.
    • If no data exists in the field, a choice list value of -- New choice -- is created.

Display invalid choice list values

By default, inactive or invalid choice list values appear in blue text instead of black. You can disable the color indicator for invalid choices.

Before you begin

Role required: admin

About this task

In the following example, the Network category has been deactivated, so it appears in blue for records that still contain the inactive value.
Choice list invalid

Procedure

  1. Navigate to System Properties > UI Properties.
  2. Clear the check box for the Display missing choice list entries property.

Adjust the choice list width

By default in UI11, all choice lists use a width of 160 pixels. You can adjust the width for all choice lists on the instance, or change the value for a particular list. This procedure is not applicable to newer versions of the UI.

Before you begin

Role required: admin or personalize_styles

Procedure

  1. To change the width for all choice list on the instance, complete the following steps (requires admin role).
    1. Navigate to System Properties > UI Properties.
    2. Change the value for the Default choice list width (pixels) property (glide.ui.choicelist.defaultwidth).
    3. Click Save.
  2. To change the value for a particular list, for example, a list with much longer option names than other choice lists, complete the following steps.
    1. Navigate to a form where the field appears.
    2. Right-click the field label and select Configure Styles.
    3. Click New.
    4. In the Style field, enter width:auto.

      Leave the Value field empty so that the field style applies to all the choices for the field.

    1. Click Submit.

      When the field is displayed, the width adjusts to the size of the content.

Add search option to a choice field

Add a search field to choice fields that have a long list of options.

Before you begin

Role required: admin

Procedure

  1. Navigate to a form that contains choice fields. For example, incident.
  2. From a choice field on the form, for example State, right-click the field and select Configure Dictionary.
  3. Switch to the advanced view for the dictionary entry form using the context menu by navigating to View > Advanced.
  4. In the Attributes field, type is_searchable_choice=true. If there are other entries in the attributes field, use a comma to separate the entries.
  5. Update the Dictionary Entry form and reload the page containing the choice list.

Result

The choice list contains a search field that users can use to filter the list of choices.
Figure 1. Choice field search
State field with the list open and a search field at the top of the list