SharePoint Designer 2013 Workflow : Find Manager Alternative

SharePoint Designer 2013 supports two types of workflows depending on your SharePoint 2013 Server Configuration.

If you are using Office 365 (SharePoint Online), you will have both

  • SharePoint 2010 Workflow
  • SharePoint 2013 Workflow

For On-premises, if Workflow Manager 1.0 is not installed and configured then you will have only SharePoint 2010 type workflow.

In SharePoint 2010 Workflow type there is a action called “Lookup Manager for User” which is used for finding the manager of a specified user.

SP2010Workflow

Unfortunately, this action is not supported in SharePoint 2013 type of workflow. ┬áSo, the alternate option is to use the WCF Service for User Profile Properties using “Call Http Web Service” action.

SPD2013Wf

Please set the following in the “Call Http Web Service” action as shown in the below screenshot.

http://aataaq.sharepoint.com/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v=[%Workflow Context:Initiator%]

SPD2013Wf2

 

For more information about how to use the WCF/Web Service in SharePoint Designer, please refer to technet article.

Working with Web Services in SharePoint 2013 Workflows using SharePoint Designer 2013

 

REST API Support for User Profile

 

1) Get all properties of current user:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties

2) Get single property of current user:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties/Manager
OR
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=Manager

3) Get Multiple Properties for the current user:

http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties?$select=PictureUrl,AccountName

4) Get all properties of Specific User:


For Office 365/SharePoint Online:
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v=’i:0%23.f|membership|mbepari@aataaq.onmicrosoft.com’

For SharePoint 2013 On-Premise:
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v=’contoso\mbepari’

5) Get Specific UserProfile Property of Specific User:

For Office 365/SharePoint Online:
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName=’LastName’)?@v=’i:0%23.f|membership|mbepari@aataaq.onmicrosoft.com’

For SharePoint 2013 On-Premise:
http://siteurl/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName=’LastName’)?@v=’contoso\mbepari’

 

 

This entry was posted in SharePoint 2013 Designer Workflow. Bookmark the permalink.

7 Responses to SharePoint Designer 2013 Workflow : Find Manager Alternative

  1. Ahmed Khan says:

    How to get user department instead user manager?

    • mokhtarbepari says:

      Hi,

      Instead of ‘Manager’ property, use ‘SPS-Department’ property in the REST API Url.

  2. Mika says:

    I’m getting the manager’s manager if I use “lookup for users manager” when selecting a traveler’s field. But when I used this same action from the created by field it works OK. I’m wondering what’s causing the problem

  3. SP123 says:

    Is there a work around for HTTPS calls?

  4. Dany says:

    Using office 365 Getting unauthorized every time using SPD, however from browser its working, what’s the problem

  5. Pingback: My Homepage

  6. Christian BUISSON says:

    What if I get a “Forbidden” responseCode ?
    Things I’ve done :
    Use an app Step, give required rights to workflow app.
    Place the “Authorization” entry in requestHeader dictionary (empty)

Leave a Reply