- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2021 08:45 AM
Hello All,
How to make a variable visible from a variable set for only one catalog item.
The below checkbox is from a variable set called approval. So I want this to be visible for only one catalog item.
Please help.
Thanks,
Priya.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2021 08:53 AM
Hi,
you can use this onload catalog client script which applies on variable set
1) determine the catalog item sys_id and hide it
function onLoad(){
var itemSysId = g_form.getUniqueValue(); // gives item sys_id
if(itemSysId != 'your item sysId here'){
// hide it
}
}
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-06-2021 08:53 AM
Hi,
you can use this onload catalog client script which applies on variable set
1) determine the catalog item sys_id and hide it
function onLoad(){
var itemSysId = g_form.getUniqueValue(); // gives item sys_id
if(itemSysId != 'your item sysId here'){
// hide it
}
}
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-06-2021 09:03 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2021 09:13 AM
Hi
Can you please replace your below script.
function onLoad(){
var itemSysId = g_form.getUniqueValue(); // give item sys_id for which variable should be available on form
if(itemSysId != 'your item sysId here'){
g_form.setDisplay('alternate_approver_check',false);
}
}
Replace sys_id with catalog sys_id for which this variable should be visible. For other items it will hidden.
Thanks,
Anil Lande
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-06-2021 10:02 PM
Thanks Anil, It is working as expected.