- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 09:07 AM
Hello guys!
I am trying to make a Lookup Select Box value (sys_id "79e7f9b2f5b49650f90a24bb174a1d0c") within a Variable Set visible, for a certain catalog item with sysID "680c964ac881c61c068b681d35cc5b1d".
The variable set is called "vgr_function_profile_mobile" while the Lookup Select Box variable is called "functionprofile_mobile". Under "functionprofile_mobile" there is this Reference Qualifier:
u_mobil_funktionsprofil=true^u_active=true^sys_id!=79e7f9b2f5b49650f90a24bb174a1d0c^ORDERBYu_utbud
I tried a solution by adding a Catalog Client Script on this specific catalog item, which looks like this:
function onLoad() {
var functionProfileField = g_form.getControl('functionprofile_mobile');
if (functionProfileField) {
var variableSet = g_form.getControl('vgr_function_profile_mobile');
if (variableSet) {
var currentSysId = g_form.getValue('sys_id');
if (currentSysId) {
g_form.addOption('functionprofile_mobile', '79e7f9b2f5b49650f90a24bb174a1d0c', 'Vårdklient Transport & städ');
}
}
}
}
However it didn't work. The Reference Qualifier is still overriding/hiding the value which I want to show only for the specific cat item.
How would you do to make the Variable Set's Lookup Select variable value 79e7f9b2f5b49650f90a24bb174a1d0c visible for the specific catalog item?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 10:38 AM
Please refer the below posts:
Solved: how to show a field in a variable set for a partic... - ServiceNow Community
Variable set should be visible on one particular c... - ServiceNow Community
If this solution helps you then, mark it as accepted solution ✔️ and give thumbs up👍!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 10:52 AM
You cannot change the reference qualifier via script, unless you are using only Service Portal, not the native UI / service catalog view. The common workaround is to create another variable for this Catalog Item with the desired reference qualifier, then hide the variable in the variable set for this one Catalog Item via UI Policy that applies to the Catalog Item, not the variable set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 10:38 AM
Please refer the below posts:
Solved: how to show a field in a variable set for a partic... - ServiceNow Community
Variable set should be visible on one particular c... - ServiceNow Community
If this solution helps you then, mark it as accepted solution ✔️ and give thumbs up👍!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 10:52 AM
You cannot change the reference qualifier via script, unless you are using only Service Portal, not the native UI / service catalog view. The common workaround is to create another variable for this Catalog Item with the desired reference qualifier, then hide the variable in the variable set for this one Catalog Item via UI Policy that applies to the Catalog Item, not the variable set.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2024 06:35 AM
Here's an alternate approach that eliminates the need to create another variable
