Show only users reporting to manager selected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 08:19 PM
Requirement :
There are two fields referenced to user table
Field 1 : Requested for ( manager is selected in this field ) and
Field 2 : What is the name of the employee ( referenced to user table )
When manager name is selected in field1 then all users on user table with manager = person selected in field should be visible in field3 .
To achieve this use reference qualifier on field2 and put this code in it.
javascript:"u_resource_type=Employee^manager="+current.variables.requested_for;
to get this query, go to user table, filter resource type = employee and manager is Michael Jakson , query looks like below
u_resource_type=Employee^manager=Michael Jakson
then remove the manager name and put everything in quotes + current.varaibles. field1 backend name.
should look like below :
javascript: "u_resource_type=Employee^manager="+ current.variables.requested_for;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 08:34 PM
so what's your question?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2025 10:14 PM
To filter the What is the name of the employee field (Field 2) based on the selected manager in the Requested for field (Field 1), use the following reference qualifier in Field 2's configuration:
Set the Reference Qualifier:
- Go to the Field 2 (What is the name of the employee) definition.
- In the Reference Qualifier field, use this script:
javascript: "u_resource_type=Employee^manager=" + current.variables.requested_for;
How It Works:
- current.variables.requested_for dynamically fetches the manager selected in Field 1 (Requested for).
- The query filters users with u_resource_type=Employee and matches the selected manager, showing only employees under that manager.