Hide/remove option

sparkles
Tera Contributor

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?

 

sparkles_0-1744752798867.png

 

8 REPLIES 8

@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....

how can I use it for one service catalog item only?

Ankur Bawiskar
Tera Patron
Tera Patron

@sparkles 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@sparkles 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader