cancel
Showing results for 
Search instead for 
Did you mean: 
JonL

"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 https://flow.microsoft.com 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"

blog1.PNG

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.

blog2.PNG

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"

blog3.PNG

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.

blog4.PNG

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

@PNWAdventureGuy

 

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.
  • Web site: https://ganeshsanapblogs.wordpress.com/ MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, Techcommunity
  • 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 #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/