How to allow HR agents to search for inactive users while creating HR Cases

raj12345
Tera Contributor

Hello Community,

I am working in the HRSD module and need help with enabling HR agents to search for both active and inactive users while creating an HR case.

Currently, the search (likely through the HR Profile or User reference field) only returns active users.

I believe this may be controlled by the Search Source or Reference Qualifier.

Can anyone guide me on how to configure the search to include inactive users as well?

Any best practices or considerations are also appreciated.

Thank you!

1 ACCEPTED SOLUTION

@raj12345 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@raj12345 

out of the box there is a query business rule on sys_user to show only active users and hence you cannot select inactive users

This is how it is OOTB

AnkurBawiskar_1-1749132865123.png

 

try this -> source for the logic is from this link

Show inactive users on a reference variable 

If it's on the portal, on the reference variable, add this advanced qualifier

AnkurBawiskar_0-1749132773479.png

 

 

 

And update the User Query business rule script to this

var query = current.getEncodedQuery();

if (gs.getSession().isInteractive() && !query.includes('activeANYTHING')) {
current.addActiveQuery();
}

AnkurBawiskar_2-1749132902465.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@raj12345 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

We have to go with search source .

From there we can achieve this .

Thanks 

@raj12345 

Please share the approach so that it helps other members in future.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader