Skip to main content

How to Get a User's Manager in Power Apps (ManagerV2)

· 4 min read
Jagdish Kumawat
Founder @ Dewiride

Approval apps need to know who someone reports to. The Office 365 Users connector's Get manager (V2), Office365Users.ManagerV2() in Power Apps, returns a person's manager straight from Microsoft 365. The catch: for anyone without a manager, it returns an error rather than a blank. Here's how to call it and how to handle that case.

Prerequisites​

Step 1: Get Someone's Manager​

ManagerV2 takes the person's user principal name (sign-in name) or Entra object ID:

Text control → Text
Office365Users.ManagerV2("daniel.brooks@example.com").displayName

The formula bar with Office365Users.ManagerV2("daniel.brooks@example.com").displayName, the preview strip reading Olivia Bennett with Data type text

It returns a Microsoft Graph user, so the fields are camelCase: displayName, mail, jobTitle, id and so on.

Step 2: Ask for Only the Fields You Need​

Like MyProfileV2, it takes a Select fields parameter, '$select':

Text control → Text
Office365Users.ManagerV2("daniel.brooks@example.com", {'$select': "displayName,jobTitle"}).jobTitle

The formula bar with ManagerV2 for Daniel with $select displayName,jobTitle and .jobTitle, the preview strip reading Head of Sales with Data type text

Fields not in the list come back blank. Microsoft's known issues recommend '$select' because the default field list can trigger 403 Forbidden in some tenants.

Step 3: The Signed-In User's Manager, Safely​

For the person using the app, pass their ID from MyProfileV2 (see How to Get the Current User's Profile and Job Title in Power Apps), and wrap the call in IfError so people without a manager get a blank instead of an error:

App → Formulas
MyManager = IfError(
Office365Users.ManagerV2(
MyProfile.id,
{'$select': "id,displayName,mail,jobTitle"}
),
Blank()
);

Without IfError, the example's admin, who has no manager, got this error: Office365Users.ManagerV2 failed: … "Resource 'manager' does not exist or one of its queried reference-property objects are not present." Fixed: Office365Users.ManagerV2 Failed: Resource 'manager' Does Not Exist walks through it.

Then test for the blank where you show it:

Text control → Text
If(
IsBlank(MyManager),
"Your Microsoft 365 profile has no manager, so nobody can review your responses yet. Ask your IT admin to add one.",
"Manager: " & MyManager.displayName
)

Common Mistakes​

MistakeWhat happensDo this instead
Calling ManagerV2 without IfErrorAn error for anyone without a managerWrap it in IfError(…, Blank())
Using DisplayName (capital D)An unknown nameUse camelCase: displayName
Using the deprecated Manager (V1)It may stop workingUse ManagerV2

Troubleshooting​

SymptomLikely causeFix
Resource 'manager' does not existThe person has no manager in Microsoft 365IfError, or set a manager
403 ForbiddenDefault fields blockedAdd '$select'
An old manager showsMicrosoft 365 hasn't been updatedUpdate the manager in Entra

FAQ​

Does IfError hide other problems too?​

Yes: any failure, not only "no manager", becomes blank. In the example, a blank manager shows a message asking the person to contact IT, which suits both cases.

Can I get the manager's manager?​

Yes. Call ManagerV2 again with the first manager's id.

Is ManagerV2 premium?​

No. Office 365 Users is a standard connector.

Conclusion​

Office365Users.ManagerV2(idOrUpn, {'$select': "…"}) returns a person's manager as a Graph user. For the signed-in person, keep it in a named formula wrapped in IfError(…, Blank()), and show a helpful message when it's blank.

Additional Resources​

Stay Updated

Subscribe to our newsletter for the latest tutorials, tech insights, and developer news.

By subscribing, you agree to our privacy policy. Unsubscribe at any time.