- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hello Team,
I have a catalog item having a check box variable called inactive users. If the variable is true, only inactive users should be available to select on the requested for variable. otherwise active users should be available to select on the requested for variable.
I have tried advanced reference qualifier with script include but having a confusion, can we validate the catalog item variable value on script include or advanced ref qual script?
Requesting to suggest a best approach for this requirement.
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
OOTB only active users are shown in reference variable
I assume your reference variable is referring to sys_user
Use this in advanced ref qualifier
javascript: var query = 'active=true'; if(current.variables.checkboxVariable.toString() == 'true') query = 'active=false'; query;
But remember you will require this workaround to show inactive users in your reference variable
How to make inactive users available for selection in reference fields/variables
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
OOTB only active users are shown in reference variable
I assume your reference variable is referring to sys_user
Use this in advanced ref qualifier
javascript: var query = 'active=true'; if(current.variables.checkboxVariable.toString() == 'true') query = 'active=false'; query;
But remember you will require this workaround to show inactive users in your reference variable
How to make inactive users available for selection in reference fields/variables
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @PrasadK43791691 ,
I implemented the approach using an Advanced Reference Qualifier along with the ref_qual_elements variable attribute, without using a Script Include.
Now the Requested For reference dynamically filters users based on the Inactive Users checkbox
- Checkbox unchecked → Active users are displayed.
- Checkbox checked → Inactive users are displayed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi @pr8172510 ,
Thanks for the response. The screenshots that you have attached is not clear. Could you please upload Adv req qual condition?
Thank you!
