How can you get manager name based on logged-in user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2021 08:11 AM
In the scoped application, I am not able to use 'javascript:gs.
Thanks
- Labels:
-
HR Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2021 08:23 AM
Hi
dot-walking is always possible.
var user = gs.getUser();
var manager = user.manager;
Kind regards
Maik
If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2021 12:31 PM
Are you trying to set this default value on a record producer variable? If so, you will need to create a Script Include and Catalog Client Script to populate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2021 10:35 PM
Hi,
that's correct.
Another way is use script in the default value and it would work
javascript: var manager; var user = new GlideRecord('sys_user'); user.get(gs.getUserID()); manager = user.manager; manager;
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
02-04-2021 09:27 PM
Hope you are doing good.
Did my reply answer your question?
If so, please mark my response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.
Thanks!
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader