Hide/remove option

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 02:34 PM
Hello!
I have a variable set called "data_options" that has variable called "choice" which contains 7 choices. The variable set used by 3 service catalog item (A,B,C). We need to hide one of the options from the choice variable for catalog item "A". I tried client script but it did work. Any idea?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 06:26 AM
@sparkles Your are trying to use removeOption on a reference field which is not supported. You need to use reference qualifier to control the options within a reference field. For more information please refer to https://www.servicenow.com/community/developer-articles/reference-qualifiers-in-servicenow/ta-p/2765....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2025 07:55 AM
how can I use it for one service catalog item only?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 07:48 PM
are you dynamically adding choices in that choice variable?
If yes then which script is doing that?
In that client script you can check the browser url and see if it contains catalog item A sysId
if yes then don't add that option
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
04-17-2025 05:05 AM
Hope you are doing good.
Did my reply answer your question?
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