- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2022 03:46 AM
When our department selects IT, only users whose departments are IT are displayed in the user search list, and users of other departments will not be displayed.How to write in Dynamic ref qual
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:48 PM
Hi,
No script include is required for this
you can update your ref qualifier as this and it would work for all the scenarios you mentioned
If department is selected it would filter and show users belonging to that department
If department is not selected it would show all users
javascript: var query = ''; if(current.department) query = 'department=' + current.department; query;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:50 PM
‘pass parameter here which comes from client script of department' How to do it? Are there any references? thank you very much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:46 PM
You can refer this thread How to write Advanced reference qualifier & Script Include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:48 PM
Hi,
No script include is required for this
you can update your ref qualifier as this and it would work for all the scenarios you mentioned
If department is selected it would filter and show users belonging to that department
If department is not selected it would show all users
javascript: var query = ''; if(current.department) query = 'department=' + current.department; query;
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:56 PM
Thank you! It worked
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2022 08:58 PM
Glad to know.
Please mark my response as correct and helpful to close the thread.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
