- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2021 02:56 AM
Hello Community,
Can anyone help us.
We have variable set with few variables and we are this variable set for couple of catalog items,
Our case we want hide particular variable in one catalog item how to do this tried with catalog client script onload and ui policy and it's not working still visible in portal Can anyone help us with solution for this
Please note this variable is mandatory in variable set
Thanks,
Nagesh
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2021 03:25 AM
Hey! Using a catalog ui policy should be the easiest solution. Set the catalog ui policy to apply on the specific catalog item, build your condition (leave empty if it should always apply) and then use an UI policy action where you set the variable from the variable set to Mandatory -> false and Visible -> false. The other attributes can stay with "Leave alone".
This should work in Service Portal as well.
The UI policy action could look like this: (Standard Employee Questions is the variable set in this example)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2021 03:45 AM
Then it should work fine.
It has worked in past
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
‎04-21-2021 05:40 AM
how to make visible variable from variable set for particular item?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2021 05:47 AM
Hi,
you can refer the same logic I shared via script
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
‎04-21-2021 05:50 AM
I tried with same login but it not worked Please see which i am trying. but i am seeing this variable in all item
function onLoad() {
if(g_form.getUniqueValue() == 'f86b7d891bafe4507703620e6e4bcb1d'){
g_form.setVisible('do_you_require_bim_capability_1', true);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2021 06:25 AM
Hi,
your onLoad should applies to Catalog Item
Also you want to make that variable as visible only for 1 item; then hide it for others
Also if that variable is mandatory then make it non-mandatory first and then hide
function onLoad() {
if(g_form.getUniqueValue() != 'f86b7d891bafe4507703620e6e4bcb1d'){
g_form.setMandatory('do_you_require_bim_capability_1', false);
g_form.setVisible('do_you_require_bim_capability_1', false);
}
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader