This project has moved and is read-only. For the latest updates, please go here.

SPGetCurrentUser properties on another user

Sep 10, 2012 at 3:34 PM

I apologize if I have missed this somewhere in the documentation.  Is there a way to pass a user login to the SPGetCurrentUser function and get the properties on a user other than the current user?  I would like to get the manager of the user that is selected in a people picker, which is never going to be the current user.  This seeminly easy thing has become a sticking point for me and is going to determine which direction I go on a project.  Users want a standard SharePoint list interface, not a web part or InfoPath, because of the spell check and familiar interface.  But they also want the manager of the selected user to display before the form is saved.  I could easily write an event receiver to populate it after they save, or even a workflow, but they want it to display on the form instantly.  This jQuery API seems to be the best route, and this brilliant SPServices library seems to be the logical place to look first.


Sep 10, 2012 at 3:39 PM

Nope, you're not missing anything. If you want to get info for a user other than the current user, you should call the User Profile Service, probably the GetUserProfileByName operation.


Sep 10, 2012 at 6:04 PM
Edited Sep 10, 2012 at 6:08 PM

At the risk of looking like a you have an example of how to implement this?  Is that code something I add to the jquery.SPServices-0.7.1a.min.js library or something I add to my NewForm.aspx page?

Sep 10, 2012 at 8:12 PM

Nevermind, I got it.  Thanks!