Skip to main content
Nintex Community Menu Bar

Get a Users Manager from Web Service call

  • Nov 9, 2015 8:48 PM UTC
  • 3 replies
  • 52 views
  • Translate All

Forum|alt.badge.img+6

I'm able to successfully call the UserGroup.asmx, but I'm stuck on how to get the users manager from the userLoginName. Is there a listing of the properties that I can access from the web service call?

 

2015-11-09_14-41-42.png

 

2015-11-09_14-43-20.png

3 replies

Forum|alt.badge.img+4
  • Nintex Partner
  • Nov 9, 2015 10:14 PM UTC

Hey Jason,

The method you're calling won't return the manager I don't think. You can find the typical result from that webservice here: https://msdn.microsoft.com/en-us/library/ms774637(v=office.12).aspx

That being said, you could get it a couple of ways. One would be using the UserProfileService.asmx, GetUserProfileByName method. This returns all properties from the User Profile Service and you'd have to write some XPath to pull out the appropriate property.

The other way, if you're using SP2013, is you could use the REST services API. You can do this with a Web Request action instead of web service (be sure to change the type from POST to GET) and use this URL:

http://YOURWEBSITEURL/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Manager')?@v='DOMAINUSERNAME'

Just replace the all caps sections and then store the result in a variable like you were doing with your webservice call. You'll still need to write some XPath to get the result out, but it will be a much simpler XPath. Here's an example of what this REST service would respond with:

<?xml version="1.0" encoding="utf-8"?><d:GetUserProfilePropertyFor xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">DOMAINUSERNAME</d:GetUserProfilePropertyFor>

Good Luck!

Owen Runnals - General Networks​

Translate

Forum|alt.badge.img+6
  • Author
  • Nov 12, 2015 4:28 PM UTC

I'm going to go down the path of the REST API, and jQuery.

Thanks,

Jason

Translate

Forum|alt.badge.img+1
  • Nintex Partner
  • Feb 22, 2017 2:44 PM UTC

To get the standard function running check at SharePoint CA if the the app pool account (Nintex) has permissions to access User Profile Service AND Search DB. That worked for us.

Best Regards

Joergen

Translate