glide_list field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 02:49 PM
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.
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:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2016 04:07 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-17-2017 08:33 PM
Hi Venkat,
I have a requirement, post creating this array can we dynamically remove and add values in the list(array)?
Regards,
Sundar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-20-2017 03:13 PM
Off course you can.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2018 08:42 AM
Hi,
were you able to achieve this?
can you help me with this as I have similar requirement?
Thanks