How To Request Manager Approval In Power Automate

How To Request Manager Approval In Power Automate

You can use a Power Automate flow to request manager approval in many different scenarios. There are two popular ways to determine a user’s manager. The Get Manager (V2) action can look for the user’s manager in the Office 365 user information. Or department managers can be stored in a SharePoint list and referenced by the flow.

Table of Contents
• Introduction: The Paid Time Off Request

Method 1: Use The Get Manager (V2) Power Automate Action
• Setup A SharePoint ListSend An Approval To A Manager In Power AutomateGet Manager Using The Office 365 Users ConnectorRun The Flow To Send An Approval To A Manager

Method 2: Get The Manager From A SharePoint List
• Setup The SharePoint ListsGet The User Profile For Department ManagerRun The Flow To Send An Approval To The Department Manager




Introduction: The Paid Time Off Request

Employees at an an insurance company use Microsoft Teams approvals to request paid time off. A Power Automate flow determines the employee’s manager and sends an approval to them.




Method 1: Use The Get Manager (V2) Power Automate Action


Setup A SharePoint List

Create a SharePoint list named Paid Time Off Requests with the following columns:

  • Requested By (person field)
  • Start Date (date field)
  • End Date (date field)
  • Manager (person field)
  • Approval Outcome (choice field)




Send An Approval To A Manager In Power Automate

Open Power Automate and build this automated flow. The flow triggers when a new item is created in the Paid Time Off Requests SharePoint list. It determines the employee’s manager using the Office 365 Users connector and sends them an approval in Microsoft Teams. After the manager responds the approval outcome is tracked in SharePoint along with the manager name.




Get Manager Using The Office 365 Users Connector

The Office 365 Users – Get Manager (V2) action in the approval flow requires a user principal name as an input. A user principal name (UPN) is a username and domain in an email address format. We can obtain this information from the SharePoint list item that triggered the flow.



Use this expression to get the user principal name from the Requested By field of the SharePoint list item. It targets the Requested By person field, selects their claims value as a text string, and then splits the text string to get the user principal name.

last(split(triggerOutputs()?['body/RequestedBy/Claims'],'|'))




Update The Manager Claims Field In SharePoint

We also require an expression in both SharePoint – Update Item actions to fill-in the Manager Claims field. Go to each action and select add a custom item from the Manager Claims dropdown.



Write this code in the add a custom item manager. The text string is formatted as a SharePoint claims value. A claims value’s purpose is to identify a user.

i:0#.f|membership|@{outputs('Get_manager_(V2)')?['body/userPrincipalName']}




Run The Flow To Send An Approval To A Manager

We are done building the flow to send an approval to a manager. Save the flow and perform a test run.



Create a new item in the SharePoint list with the following values:

  • Requested By – Sarah Green
  • Start Date – 6/1/2024
  • End Date – 6/4/2024



The flow determines that Matthew Devaney is the Manager of Sarah Green and sends him an approval in Microsoft Teams.



The Manager (Matthew) approves Sarah’s Paid Time Off Request.



Then the flow updates the approval outcome and adds the Manager to the list item in SharePoint.




Method 2: Get The Manager From A SharePoint List


Setup The SharePoint Lists

Create a SharePoint list named Paid Time Off Requests with the following columns:

  • Requested By (person field)
  • Start Date (date field)
  • End Date (date field)
  • Department (lookup field)
  • Manager (person field)
  • Approval Outcome (choice field)



Then create another SharePoint list named Company Departments with the following fields. Populate the list with department names and managers.

  • Title (text field)
  • Manager (person)




Get The User Profile For Department Manager

Open Power Automate and create the following automated flow. The first two flow actions are different from the first method, and the rest of the flow users the same actions.

We start by finding the related department in the Company Departments SharePoint list. Then we use the Get User Profile (V2) action to get the Manager’s details. The flow sends the manager an approval and tracks the outcome in SharePoint.




Write Power Automate Expressions For The Approval Flow

Use this flow expression in the User (UPN) field of the SharePoint – Get Item action.

last(split(outputs('Get_item:_Department')?['body/RequestedBy/Claims'],'|'))



Then write this code in the Manager Claims field of both SharePoint – Update Item actions as a custom item.

i:0#.f|membership|@{outputs('Get_user_profile_(V2)')?['body/userPrincipalName']}




Run The Flow To Send An Approval To The Department Manager

We are done building the flow to send an approval to a manager. Save the flow and perform a test run.



Create a new item in the SharePoint list with the following values:

  • Requested By – Sarah Green
  • Start Date – 6/1/2024
  • End Date – 6/4/2024
  • Department – Finance



The flow determines that Matthew Devaney is the Manager of Sarah Green and sends him an approval in Microsoft Teams.



The Manager (Matthew) approves Sarah’s Paid Time Off Request.



Then the flow updates the approval outcome and adds the Manager to the list item in SharePoint.




Questions?

If you have any questions or feedback about How To Request Manager Approval In Power Automate please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

Matthew Devaney

Subscribe
Notify of
guest

1 Comment
Oldest
Newest
Inline Feedbacks
View all comments
Lina Delgado
Lina Delgado
8 days ago

Hello Matthew! I’m working on an HR Form for evaluation from employee to manager, manager to employee. I can apply this to my form and flow, but is there a better way to move this Form between both parts? Appreciate your answer and guidance