glide_list field

Saurabh Kolte
Kilo Contributor

we have a requirement like for particular type of change (normal or emergency) we have to show only particular set of values in list(glide_list) field on the form.

Please see the below sample screenshot of my dev instance. test is the field label here.

find_real_file.png

Here test field is glide list type field. it is reference field of some values stored in the table like A,B,C,D,E,F.

So is it possible that dynamically populate the options like for normal change only A,B,C value   user should be able to select and for emergency change only D,E,F   user should be able to select?

I know we can do it for drop down field by client script(addOption and removewOption) but is there any way to implement similar kind of functionality for this type of field.

Any help would be highly appreciated.

Thanks in advance:)

4 REPLIES 4

vkambham
Tera Expert

Saurabh,


A GlideList field is an array of comma delimited sys_ids, so you can dynamically create an array and assign it to the glide list field.   Check the examples in the below link.


http://wiki.servicenow.com/index.php?title=Referencing_a_Glide_List_from_a_Script#gsc.tab=0



-Venkatesh


Hi Venkat,



I have a requirement, post creating this array can we dynamically remove and add values in the list(array)?




Regards,


Sundar


Off course you can.


Bargavi
Mega Expert

Hi,

were you able to achieve this?

can you help me with this as I have similar requirement?

Thanks