How to create a Multi-Choice DropDown on Incident Form?

home
Kilo Contributor

Hi,

I want to create a field on Incident form same as "Is one of" field for selection of multiple dropdown.
Please let me know if its possible?

find_real_file.pngfind_real_file.png

7 REPLIES 7

You can also point it to the choices of another field using the "Choice table" and "Choice field" fields. They are hidden by default for Type=List, but you can list-edit them. Or you can temporarily switch the Type to String (which will show the fields), then make the change to these extra choice fields and then change the Type back to List before you save.

James Fricker
Tera Guru

This method also supports multi-language choice options automatically.

You can also point it to the choices of another field using the "Choice table" and "Choice field" fields. These other table/field fields are hidden by default for Type=List, but you can list-edit them. Or you can temporarily switch the Type to String (which will show the fields), then make the change to these extra choice fields and then change the Type back to List before you save.

Another option that works is to use a "<table>_<field>GetChoices" global business rule to define the choices for the list. For example you could use a system property to define the list of choices. See BR "sys_sg_master_item_tableGetChoices" for an example.

You can see other examples of GetChoices BRs in your system
https://<your_instance_name>.service-now.com/sys_script_list.do?sysparm_query=nameLIKEgetchoices

Script include "DemandStageChoices" is a useful resource for scripted choices.

The dictionary attribute "start_locked=false" works for these choice lists, which maybe useful for some.

Another option for generating choice options via script is to use the choice_script= dictionary attribute. This also works for these multi-select choice List fields. This is a more explicit way of signalling that the choices are generated by a script.

The only issues I can see with these choice list fields is that when the field is shown in a list view it is the choice value that is displayed and not the choice label. Also when filtering on one of these fields the filter does not provide a list of options to select from, only a plain text box to type the search value into.

It does not appear possible to make the choice list field to be dependent on another field. For example having subcategory as a multi-select choice list dependent on a single-select category choice field does not appear to work. I tried this with both fixed sys_choice options and script generated options. Neither allowed a dependency link to another field.

I have seen plenty of fields of type List using the choices table as the reference table, but this approach means the sys_id of the choice record is stored in the list field instead of the choice value. And it does not support multi-language choices automatically. Also the list filter for these fields show every single sys_choice value (over 340K of them on our instance).

Even some OOTB fields use this hacky sys_id approach which break for multi-language choice options. A few examples...
sys_flow_step_definition.availability
sys_soap_message_function.ws_security_type

Another option is to use a Slushbucket field (the sys_glide_object record has to be unlocked first).

(function(){
var gr = new GlideRecord('sys_glide_object');
gr.get('name', 'slushbucket');
gr.visible = true;
gr.update();
})();

find_real_file.png

There are 2 problems with SlushBucket fields. First is the list filter operators are not conducive to searching for one of the options. For example there is no "contains" or "not contains" operators. This is one thing that multi-select choice glide_list fields do provide. Second they only show the values (not the labels) in the list view.