Get user location with getUser
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 08:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2020 10:21 AM
Hi,
so use this to compare the location
gs.getUser().getLocation() == 'locationSysId'
if my answer helped you, kindly mark it as ✅ Correct & 👍Helpful based on the Impact.
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
06-01-2020 09:44 AM
you can use something like in condition
gs.getUser().getLocation() == 'SYS_ID_of_location';
if you want just location than use (below will give you sys_id of location)
gs.getUser().getLocation();
Refer to below for more info functions
https://www.servicenowguru.com/scripting/user-object-cheat-sheet/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2021 03:23 AM
Hi,
How to get the location not sys_id.