- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 12:40 AM
Hello All,
Hope all of you are doing well.
I have a requirement wherein we would like to show inactive users to the non-admin users in the reference field on a catalog item. As per default behavior of ServiceNow, system does not show inactive users to non-admin users on a catalog item. There is a workaround available for the same in the following link, however, it is not working for me.
https://community.servicenow.com/community?id=community_question&sys_id=3b7d032ddb9cdbc01dcaf3231f96190e
I have modified my query BR as follows wherein I have mentioned sys_id of the catalog item for which I would like to show inactive users to non-admins. Having said that, logic is not working as non-admin users can still search for active users only. Above mentioned community link also states to modify the reference qualifier for this reference field but is it not very much clear what exactly to add in the reference qualifier.
Any help will be highly appreciated.
Thanks & Regards,
Gulzar Manuja
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 02:28 AM
Hi Gulzar,
Did you amend the script in the user query BR to that in the post above?
var query = current.getEncodedQuery()
if( gs.getSession().isInteractive() && !query.includes('activeANYTHING') )
current.addActiveQuery()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 03:50 AM
Hi Gulzar
It will only affect reference fields where activeANYTHING is set as a qualifier.
Are you able to post your client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 05:01 AM
Thanks for the confirmation, Kev. Appreciate your help.
Had a discussion with a friend and he helped me correct the client script/script include. Going to mark your answer correct as I was able to get inactive users in the reference field for non-admins by following the solution suggested by you. Thanks again !!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 03:40 AM
Hi, did you try this condition for the existing business rule?
if (!gs.hasRole('user_admin') && !gs.hasRole('view_inactive_user') && (current.getEncodedQuery().indexOf('sys_id>')== -1))
If this information has helped you, please mark answer as helpful/correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-13-2022 04:57 AM
Hi Swapnil,
Thanks for your response. Yep, tried it. It's not working unfortunately.
Best Regards,
Gulzar Manuja