The CreatorCon Call for Content is officially open! Get started here.

How to Get logged in user department in workflow

RudhraKAM
Tera Guru

Can some one give me the code for getting the logged in user department 

I tried gs.getUser().getDepartmentID();  and getDepartmentID()  none of them worked 

1 ACCEPTED SOLUTION

RudhraKAM
Tera Guru

obj.u_department = current.opened_by.department;  is the fix 

View solution in original post

15 REPLIES 15

Johnny17
Kilo Expert
 
    var interUser = gs.getUser().getID();
    var userRec = new GlideRecord('sys_user');
    userRec.get(interUser); 
    var result = userRec.department.getDisplayValue();

// If you want the object, you can skip the .getDisplayValue() at the end.