- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 03:02 AM
I have a catalog variable 'Is the exemption related to an incident or change' having 3 values neither, incident and change. Have another catalog variable 'which policy' refers to a custom table. The requirement is if the value of the catalog variable 'Is the exemption related to an incident or change' is selected as 'change' or 'incident' then only the policies that have the column INCCHGException= True will be shown for the variable 'which policy' and if the value of the catalog variable 'Is the exemption related to an incident or change' is selected as 'neither' then all values will be displayed.
Can anyone please help me out.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 03:23 AM
basically you will have to add reference qualifier on 2nd variable based on value of 1st so that it filters out the records
use this in 2nd variable's reference qualifier field
javascript: var query = '';
var val = current.variables.1stVariable; // give the variable name here
if(val == 'incident' || val == 'change') // give here the correct choice values
query = 'columnName=true'; // give here the correct column name which has true/false value
query;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 03:08 AM
SIMPLEST way (but has more nodes on the flow) is to simply *IF* it all out.
IF "exemptionRelated" = incident OR "exeptionRelated" = change
lookup records in <custom table> with <conditions you want>
ELSE
lookup records in <custom table> with <other conditions you want>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 03:23 AM
basically you will have to add reference qualifier on 2nd variable based on value of 1st so that it filters out the records
use this in 2nd variable's reference qualifier field
javascript: var query = '';
var val = current.variables.1stVariable; // give the variable name here
if(val == 'incident' || val == 'change') // give here the correct choice values
query = 'columnName=true'; // give here the correct column name which has true/false value
query;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 05:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2024 05:43 AM
it should work.
I hope you have not copied it directly but made the necessary changes in your instance.
share what you did?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader