Get a user from a specific department for a specific view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2024 01:42 PM
I am using:
if(gs.getUser().isMemberOf('department')
It will work for retrieving a user in a specific group, but not a department.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2024 01:47 PM
Hi,
You can try
gs.getUser().getRecord().getValue('department')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2024 06:18 PM
You can use like this
gs.getUser().getDepartmentID()
Thanks,
Narsing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-18-2024 07:24 PM
what's your exact requirement?
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-18-2024 09:02 PM
Hello @User393503
Use getValue()
Try with -
if(gs.getUser().getRecord().getValue('department'))
if my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
CB