- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 06:15 AM
Hi,
I have created a field of type 'glide_list' as users want to select multiple values in it and have added choices to this field. However, I am unable to add or remove options on this field based on other field value.
Any suggestions would be greatly appreciated.
Regards,
Sunil
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2025 08:26 PM
Hey Sunil,
I did some testing on my own and I was able to get this to work (in contrast to my previous reply). This is a little experimental (and guesswork), so your millage may very. Try this in your onChange client script:
g_form.removeOption('choice.incident.<variable_name>', '<choice_value>');
Replace <variable_name> with the Column Name of your variable, and <choice_value> with your choice Value. If you are on a different table, try replacing incident with your table name (or inspect the HTML to see what is listed for that element).
Basically I inspected the HTML element for the Glide List field and saw that choice.incident was a prefix of the field name. Running g_form.RemoveOption() in my browser console successfully removed the option. See attached for examples.
Remember that you will need to use g_form.addOption() to re-add any options you removed client-side if needed.
Hope this helps! Let me know if you need an example of a client script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 06:31 AM
Since that glide list is referring to sys_choice, those are sysIds, so you will have to add reference qualifier to filter
add or remove option won't work there.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 08:55 AM - edited 05-09-2025 08:58 AM
Hi @Ankur Bawiskar - Thanks for your response. There is no reference as you can see below.
However, as this field type usually deals with sys_ids, let me try and get back to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2025 09:06 AM
did you try what value you get when you use alert?
I haven't used glide list with choice
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 09:10 AM
Hi @Ankur Bawiskar , tried with sys_id and other possibilities as well but no luck. I'm not sure if there is a way to handle choices in glide_list.