Automating Manager Approval Requests with Power Automate
Streamline leave-request approvals by automatically routing the request to each employee's manager, using either the Office 365 directory or a custom manager lookup list.
Approval workflows often require knowing who the requestor's manager is. Instead of asking the employee to enter a manager name manually (which invites errors and out-of-date data), you can have Power Automate resolve the manager automatically. Below you'll find two proven approaches: one leverages the Office 365 directory, the other relies on a dedicated SharePoint list that maps departments (or other attributes) to managers.
Both methods use the same trigger and approval actions, so you can choose the one that best fits your environment. The example scenario throughout is a leave-request system, but the same pattern works for expense reports, time-off, or any other manager-approval process.
Example Scenario
Contoso Ltd uses a SharePoint list called LeaveRequests to track employee time off. When a new request is submitted, a Power Automate flow must:
- Identify the submitter's manager.
- Send an approval request to that manager.
- Write the approval outcome and manager name back to the list item.
The LeaveRequests list contains these columns:
| Column Name | Data Type | Notes |
|---|---|---|
| Employee | Person | The person requesting leave (triggered by this field). |
| StartDate | Date and Time | First day of leave. |
| EndDate | Date and Time | Last day of leave. |
| ApprovalStatus | Choice | Pending, Approved, Rejected. |
| ManagerLookup | Person | Populated by the flow with the manager's identity. |
In the second method, an additional list named DepartmentManagers will map departments to their responsible managers.
Option A: Use the Office 365 Directory (Get Manager V2)
This approach assumes that the manager relationship is correctly set up in Microsoft Entra ID (formerly Azure AD) or on-premises Active Directory synced to Entra ID.
Flow Structure
- Trigger: When an item is created in the LeaveRequests list.
- Get Manager (V2): Office 365 Users connector – requires the User Principal Name (UPN) of the employee.
- Start and Wait for an Approval: Approval connector – send to the manager.
- Update Item (two actions): Update the ApprovalStatus and ManagerLookup fields based on the approval outcome.
Extracting the UPN from the Person Field
The Employee column returns a complex claims string. To extract the UPN, use this expression in the User Principal Name input of the Get Manager (V2) action:
last(split(triggerOutputs()?['body/Employee/Claims'], '|'))
This splits the string on the pipe (|) character and takes the last element, which is the UPN (e.g., alex.rivera@contoso.com). (If your environment uses a different claims format, adjust accordingly.)
Sending the Approval
After the manager's UPN is retrieved, the Start and Wait for an Approval action uses that UPN as the Assigned To value. The manager will receive the request in the Microsoft Approvals center (Teams, email, or mobile).
Writing the Manager Back to SharePoint
Once the manager responds, you need to update the ManagerLookup person field in the list item. The claims format required by SharePoint looks like:
i:0#.f|membership|<ManagerUPN>
Use this expression in a Compose action placed before the Update Item action, or inline in the ManagerLookup custom value input:
concat('i:0#.f|membership|', outputs('Get_manager_(V2)')?['body/userPrincipalName'])The claims prefix i:0#.f|membership| is specific to SharePoint Online and must be placed exactly before the UPN. The parentheses in Get_manager_(V2) may differ if your action is named differently.
After the approval completes, place a Condition to check the outcome and then update both the ApprovalStatus choice column and the ManagerLookup person column.
Testing the Flow
- Create a new leave-request item for an employee whose manager is defined in the directory.
- Verify that the flow triggers and that the correct manager receives the approval.
- After the manager approves or rejects, confirm that the list item shows the updated status and the manager's name.
Option B: Use a Custom Manager Lookup List
If the manager hierarchy is not maintained in the directory (common for department-based organizations or external contractors), store the relationship in a SharePoint list.
Additional List: DepartmentManagers
Create a list named DepartmentManagers with these columns:
| Column Name | Data Type | Notes |
|---|---|---|
| Title | Text | Department name (e.g., Finance, Engineering). |
| Manager | Person | The manager responsible for that department. |
Populate the list manually or through a separate process.
Modified Flow Steps
- Trigger: When an item is created in LeaveRequests.
- Get Item: Retrieve the Employee person field from the trigger output.
- Get Items: Filter DepartmentManagers where Title equals the value from the new item's Department field (a text column you need to add to LeaveRequests for this method).
- Get User Profile (V2) (optional): If the manager returned by Get Items is a Person field, you can directly use its UPN. Using Get User Profile (V2) ensures you have the correct UPN and other details.
- Start and Wait for an Approval – send to the manager UPN.
- Update Item – update ApprovalStatus and the ManagerLookup column using the same claims format as in Option A, but referencing the output of Get User Profile (V2).
Extracting the Manager UPN from the Lookup List
If you use Get User Profile (V2), you provide it with the UPN of the manager. You can obtain that UPN from the Manager person field of the DepartmentManagers item using a similar extraction expression:
last(split(outputs('Get_items:_DepartmentManagers')?['body/value']?[0]?['Manager/Claims'], '|'))Because Get Items returns an array, [0] assumes the department name is unique – you should design your solution with uniqueness in mind, or add a Get Item action instead of Get Items if you have a single match.
If multiple items match the department name, Get Items will return an array. Use a Filter array or Select action to pick the first element, or better, use a lookup column that guarantees a single result.
Updating the ManagerLookup Field
Use the same claims concatenation as in Option A, but with the output of the Get User Profile (V2) action:
concat('i:0#.f|membership|', outputs('Get_user_profile_(V2)')?['body/userPrincipalName'])Testing the Flow
- Create a leave-request item, supplying a department that exists in DepartmentManagers.
- The flow should fetch the correct manager and route the approval there.
- After the manager acts, the list item must be updated.
Security and Performance Considerations
- Permissions: The flow uses the connector's connection (usually the flow owner's account). Ensure that account has at least read access to the Office 365 Users connector and appropriate permissions on the SharePoint lists.
- Delegation: In Power Automate, the Get Manager (V2) action and Get User Profile (V2) are connectors, not delegated queries; they run with the connection owner's privileges.
- UPN extraction: The
splitexpression shown works for the default claims format. If your tenant uses a different identity provider or custom claims, test with real data first. - Error handling: If a user has no manager defined in the directory, the Get Manager (V2) action will throw an error. Use a Configure Run After or a Scope to catch that and fall back to a manual entry or default approver.
Common Mistakes and Troubleshooting
| Issue | Likely Cause | Solution |
|---|---|---|
| Flow fails on Get Manager (V2) with "User not found". | The Employee person field is empty, or the UPN extraction expression is incorrect. | Check the Claims property of the person field in the trigger output. Use triggerOutputs()?['body/Employee/Claims'] in a Compose to inspect. |
| Approval is sent to the wrong person. | The manager UPN is resolved incorrectly, especially if the manager list uses display names instead of UPNs. | Ensure the Get User Profile (V2) input is the correct UPN, not a display name. |
| The ManagerLookup update fails with "Invalid look-up value". | The claims string is malformed. | The concat must produce exactly `i:0#.f |
| Flow runs but does not update the list item. | The Condition after approval might be checking the wrong outcome string (e.g., "Approve" vs "Approved"). | Inspect the approval action outputs to see the exact values of outcome. |
Which Approach Should You Use?
- Option A (directory-based) is the most straightforward when your organization's management hierarchy is maintained in Microsoft Entra ID. It requires no additional list management and stays synchronized automatically.
- Option B (custom lookup) gives you full control when the manager assignment doesn't follow the directory structure – for example, contractors grouped by project manager, or departments that are not reflected in the directory.
For hybrid scenarios, you can combine both: try Option A first, and if it fails, fall back to Option B. Use a Scope action and configure Run After for failure of the Get Manager (V2) call.
Your Next Steps
- Decide which method (or combination) fits your organization.
- Prepare the SharePoint lists and test with a small group of users.
- Import the sample flow or build from scratch using the patterns above.
- Monitor the flow runs in the Power Automate portal and adjust error handling as needed.
Remember to keep the approval actions user-friendly – include clear details about the request (dates, reason) in the approval message.
References
- Original article: How To Request Manager Approval In Power Automate – Matthew Devaney
- Microsoft Learn: Get Manager (V2) action reference
- Microsoft Learn: Introduction to approval flows
- Microsoft Learn: Understanding SharePoint person field claims