Showing results for 
Search instead for 
Did you mean: 

"Get Manager" For SharePoint Document Library Approvals

Hey Everyone,

Recently people have been coming to me with a common issue. They're stoked that SharePoint Document libraries are now supported in approvals, but they notice that when triggering off "when a file is created" that you arent able to expose the "get manager" action  in O365 to be able to send approval to the document creators manager dynamically.


I went to the team with this dilemma and thanks to @merwan - he showed me this wonderful little workaround that i now want to share with you.

First, lets set up a couple of things ahead of time.


This tutorial assumes you have a SharePoint Document library, and for ease of use, its named "Documents"

Next, it also assumes you use O365 in your environment. If you dont have O365, this tutorial wont be as relevant for you.

Ok so first things first, 


1. Head to and login

2. Click on My Flows

3. Click on "+ Create from blank"

4. Add an action -> Select SharePoint -> "When an existing item is modified" -> enter your SharePoint url and then where it asks you to choose your list.. Manually type "Documents" (or whatever your Document library is named"


5. Add an action -> O365 -> Get Manager -> Open the dynamic content picker and use the SharePoint content piece "CreatedBy Email" this tells the O365 service to look up the manager of the person who created the document in the library. We will use this for the approval in a moment.


6. Next, Add a condition. (This is where the hackyness of this tutorial comes in. We are going to trick Flow into allowing us to see newly created items, and also acquire the manager of the creator, a function we couldnt achieve logically with the actions and triggers we were provided) and Make the condition read "Modfied" is equal to "Created"


7. In the IF YES column, add the "Approvals" Service and choose -> Start an approval.

8. Set all of your fields as desired in the approval email, the one important field being where it says "Assigned to" make sure andpass the "Email" dynamic content piece from O365 which represents the creators manager.


9. And voila! Thats all there is to it. 


Now obviously, this flow isnt finished. It needs some additional actions under the approval as far as sending email to notify the user of approval or rejection, or maybe a push notification or maybe the Flow copies the file once approved to a seperate location.


How would you finish this flow? What steps should i add next?


Let me know if you guys have any questions!


- Jon L

Senior PM- Flow Team




I'm not sure I understand. When I create a flow with the "when a new item is created" trigger, I am able to add a "get manager" action. What am I not understanding about about the item created vs modified triggers that would impact the use of the get manager action?

Jon, We are in a situation were we do not use the same Email as UPN. I find the Approval flow cannot locate the users manager when email does not match UPN. I have raised issue on the forums but got no good response. Any way to surface UPN instead of email in the dynamic created by content?

@Mike2500 Thats correct - "Create item" refers to creating a list item - The purpose of this blog is a workaround for this same "Get Manager" action, which isnt exposed by default when tryign to use "When a new file is created" for Flowing certain actions off of Document Libraries

@JonL-MSFT, understood, but in step 4, instead of using "When an existing item is modified", you could have just used  "When an item is created", which means you could have avoided the "hacky" step 6. Either trigger is based on the list item, and should have access to the metadata fields that the file triggers lack.


@Mike2500 - Ahhhh got it. At the time of writing this, that fix hadnt been deployed yet. Glad to see it rolling out now. Ill erase this post in a few weeks when the rollout is complete.

@JonL-MSFT, could you clarify which fix is rolling out? Is what you're talking about perhaps related to this question I posted earlier today?



@MikeE the new SharePoint connector rolled out a week ago


We now return the

  • URL to the item
  • Name (file name for document libraries, item title for lists)
  • Folder path
  • File identifier

@JonL-MSFT Any help with the issue I posted above Jon? Really I just want to make sure you guys realize/acknowledge out of the box approval flows fail for users that do not have the same UPN as Email address.

So, this missing functionality was entered as a User Voice item in June 2016. The SharePoint list item data for a document is fundamental to any user with SharePoint background. The fact that it is missing is unfathomable to them. Twice now I have seen Flow discarded because the connector does not offer this functionality without this work-around.

The User Voice item is here:

Meet Our Blog Authors
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • SharePoint, Microsoft 365 and Power Platform Developer | Contributor on SharePoint StackExchange
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 12 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – Youtube channel -