Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Display different user lists according to the selected department

____39
Tera Contributor

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

find_real_file.png

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

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

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

View solution in original post

9 REPLIES 9

‘pass parameter here which comes from client script of department' How to do it? Are there any references? thank you very much!

Ankur Bawiskar
Tera Patron
Tera Patron

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

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

Thank you! It worked

Glad to know.

Please mark my response as correct and helpful to close the thread.

Regards
Ankur

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