After going through the below link, I would like to achieve/get the same functionality in my SPO site using JSOM. How can I get list of all users reporting to perticular user using UserProfileManager?
How to get the reportees of a manager from a SPO site, any CSOM/JSOM APIs available for this module?
is there ant API in JSOM[only javascript] that is similar to the below userprofilemanager
and GetDirectReports()
:
UserProfileManager userProfileManager = new UserProfileManager(serverContext); // Check whether the user profile and the manager user profile exist, //and that they are not // the same user. if (userProfileManager.UserExists(loginName)) { // Retrieve the user profile. UserProfile userProfile = userProfileManager.GetUserProfile(loginName); // Get the user's multiple levels of managers, peers, and //direct reports. managers = new List<UserProfile>(userProfile.GetManagers()); peers = new List<UserProfile>(userProfile.GetPeers()); directReports = new List<UserProfile> (userProfile.GetDirectReports()); }
Note:Want to make it a community post