Skip to main content

How to Get a User's Direct Reports in Power Apps (DirectReportsV2)

· 5 min read
Jagdish Kumawat
Founder @ Dewiride

To show a manager their team, you need the people who report to them. The Office 365 Users connector's Get direct reports (V2), Office365Users.DirectReportsV2(), returns them from Microsoft 365. It has one quirk that trips everyone up: the people are inside a .value table. Here's how to call it, shape the list, and turn it into a simple "is this person a manager?" check.

Prerequisites​

  • The Office 365 Users data source in your app. See Part 3 of the Career Development Plan series.
  • Managers set in Microsoft 365. In the example's demo organization, the admin manages Olivia Bennett, and Daniel Brooks manages Aisha Khan and Leo Martin.

Step 1: Call It and Use .value​

DirectReportsV2 takes a user principal name or Entra object ID, and returns a record whose value column holds the table of people. To list their names, the example joins them with Concat (see How to Join Table Values into Text in Power Apps with Concat):

Text control → Text
Concat(Office365Users.DirectReportsV2(MyProfile.id).value, displayName, ", ")

The formula bar with Concat(Office365Users.DirectReportsV2(MyProfile.id).value, displayName, ", "), the preview strip reading Olivia Bennett with Data type text

For someone with more reports:

Text control → Text
Concat(Office365Users.DirectReportsV2("daniel.brooks@example.com").value, displayName, ", ")

The formula bar with DirectReportsV2 for Daniel, the preview strip reading Aisha Khan, Leo Martin with Data type text

Forget .value and the formula breaks:

The formula bar with Concat(Office365Users.DirectReportsV2("daniel.brooks@example.com"), displayName, ", ") underlined in red and a tooltip reading Invalid argument type

Studio reported The function 'Concat' has some invalid arguments and Invalid argument type: Concat needs a table, and the call returns a record.

Step 2: Select Fields, Keep Enabled Accounts, Sort by Name​

The example keeps the team in a named formula:

App → Formulas
MyDirectReports = Sort(
Filter(
Office365Users.DirectReportsV2(
MyProfile.id,
{'$select': "id,displayName,mail,userPrincipalName,jobTitle,accountEnabled"}
).value,
accountEnabled
),
displayName
);

Part 10 of the series will test the leaver case with a blocked account.

Step 3: Is This Person a Manager?​

A manager is someone with at least one direct report:

App → Formulas
IsManager = !IsEmpty(MyDirectReports);

In the example, it's true for the admin. Use it to show manager-only parts of the app; see How to Show or Hide a Control in Power Apps with Visible, IsBlank vs IsEmpty in Power Apps and How to Use Not in Power Apps.

Common Mistakes​

MistakeWhat happensDo this instead
Forgetting .valueInvalid argument type errorsDirectReportsV2(…).value
Filtering on accountEnabled without selecting itNobody passes the filterInclude it in '$select'
Using the deprecated DirectReports (V1)It may stop workingUse DirectReportsV2

Troubleshooting​

SymptomLikely causeFix
An empty list for a managerReports not set in Microsoft 365, or filtered outCheck the managers in Entra; check '$select'
403 ForbiddenDefault fields blockedAdd '$select'
A leaver still appearsTheir account is still enabledBlock sign-in, or remove their manager

FAQ​

Is there a limit on how many come back?​

By default, all of them. The Top parameter ('$top') can limit the number.

Yes. Set the gallery's Items to MyDirectReports. Part 7 of the series does this, with a column added for responses waiting for review.

Does it include indirect reports?​

No. Only people who report directly to that person.

Conclusion​

Office365Users.DirectReportsV2(id, {'$select': "…"}).value is a table of a person's direct reports. Select the fields you need, filter on accountEnabled, sort by displayName, and !IsEmpty(…) tells you whether someone is a manager.

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.