- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:15 AM
I am trying to populate a form with the logged in user manager email. I can get the manager name using the manager ID but I am have a little bit of challenge getting the manager email address.
I found this article to get manager of manager. I tried to tweak it without any luck.
How can you get manager of manage of logged-in user as default value?
gs.getUser().getUserByID(gs.getUser().getManagerID()).getManagerID();
Any guidance or direction greatly appreciated.
thanks
Alex
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:18 AM
Hi Alex,
You will need to call a glide record for this, the below should work.
var manager = new GlideRecord('sys_user');
manager.get(gs.getUser().managerID);
manager.email
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-15-2018 07:38 AM
var manager = new GlideRecord('sys_user');
manager.get(gs.getUser().managerID);
manager_email=manager.email;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2018 03:24 AM
Hi Alex,
Use Script include code mentioned below:
getMEID: function(){
var mid = gs.getUserID();
var gr = new GlideRecord("sys_user");
gr.addQuery('sys_id', mid );
gr.query();
var meid = '';
if (gr.next()) {
meid = gr.manager.email;//.email;
}
return meid;
},
Client Script:
var ga = new GlideAjax('GetManagerEmail') ;
ga.addParam('sysparm_name','getMEID');
ga.getXMLWait();
alert(ga.getAnswer());
Thanks
Jyoti soni

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2019 04:54 PM
Hello runfast,
You donot need to write any script for this
OOB this is available using this way
var managerID = gs.getUser().getManagerID();
Hope this helps
Mark the response as correct if that really helps so that others having the same question can find it easy
Thanks,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2020 08:11 AM
Hi runfast, this worked for me very well.
javascript:gs.getUser().getUserByID(gs.getUser().getManagerID()).getRecord().getDisplayValue("email");
regards,
Tony.