- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 01:53 AM
Hello,
I need some advise and help please.
We are using a variable set which sets variables for multiple catalog items / record producers.
This variable set is included in many items, and the variable set calls script includes to check logic and show fields accordingly.
We have a requirement to hide some of the options from a few catalog items, without affecting the others.
What is best way I can hide some fields on certain catalog items please?
have tried using UI policies on the actual catalog items that need hiding but that does not work.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 01:55 AM
Hi,
something like this
onLoad catalog client script which Applies on Variable Set
function onLoad(){
var itemSysId = g_form.getUniqueValue();
if(itemSysId == 'your Catalog item SysId'){
// hide variables with that variable set one by one
}
}
If you are thinking hard-coding is not best practice then use onLoad client script + GlideAjax and within that ajax function use getProperty() to get catalog item sysId and then compare and return true/false
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 04:23 AM
Thanks Ankur, you are most likely right, there are quite a few UI policies and client scripts for this variable set.
What would be your suggestion on how to move forward with this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 04:29 AM
Hi,
You need to debug which one is responsible and discuss with your customer what's their exact requirement.
I believe I have answered your original question.
Please mark my response as correct and helpful to close the thread.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 02:02 AM
Hello,
UI policy show work 100%, make sure you create UI policy on Catalog item level and not at variable set level, This is simple
Regards
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 02:17 AM
Regards,
Musab