cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tamras
Level 10

Get all users with same manager info

Is there a way to pull all user info with same manager info? 

I obtained the current user manager info using 

 

Office365Users.Manager(User().Email).DisplayName

 


I added a gallery or create a collection where I want to filter/store all user information under the same manager. I'm stuck trying to figure out what my source should be. Tried below but it listed everyone...

 

Filter(Office365Users.SearchUser(), Office365Users.Manager(User().Email).DisplayName)

 

The gallery only has one text field

 

DisplayName

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Get all users with same manager info

Hi @Tamras ,

Please consider modify your formula as below:

ClearCollect(
             myTeam, 
             Filter(
                     Office365Users.DirectReports(Office365Users.Manager(User().Email).Mail),
                     AccountEnabled = true
             )
)

 

More details about Filter function, please check the following article:

Filter function

 

Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Tamras
Level 10

Re: Get all users with same manager info

I think I found the answer using DirectReports().  I didn't understand the description when I first read it but found another post after searching "Delve Organization."

Created a collection first then used the collection in the gallery

 

 

ClearCollect(myTeam, Office365Users.DirectReports(Office365Users.Manager(User().Email).Mail))

 

 

 

But now I need to figure out how to only display 'active' users.  The list of staff on Delve is correct but the gallery is also displaying staff that are no longer 'active.'

Super User
Super User

Re: Get all users with same manager info

@Tamras 

To pull the entire table of users for a manager logged into the app you should be using DirectReportsV2 instead.

ClearCollect(
    myTeam,
    Office365Users.DirectReportsV2(Office365Users.Manager(User().Email).value)
)

 

If you only want to see the active users you can FILTER the result where accountEnabled = True

ClearCollect(
    myTeam,
    Filter(
        Office365Users.DirectReportsV2(Office365Users.Manager(User().Email).value),
        accountEnabled=true
    )
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Community Support Team
Community Support Team

Re: Get all users with same manager info

Hi @Tamras ,

Please consider modify your formula as below:

ClearCollect(
             myTeam, 
             Filter(
                     Office365Users.DirectReports(Office365Users.Manager(User().Email).Mail),
                     AccountEnabled = true
             )
)

 

More details about Filter function, please check the following article:

Filter function

 

Best regards, 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Tamras
Level 10

Re: Get all users with same manager info

@mdevaney   Not sure if I'm doing something wrong but both below results in empty fields.

ClearCollect(
    myTeam,
    Office365Users.DirectReportsV2(Office365Users.Manager(User().Email).Mail).value
)

 

ClearCollect(
    myTeam,
    Filter(
        Office365Users.DirectReportsV2(Office365Users.Manager(User().Email).Mail).value,
        accountEnabled = true
    )
)

If I remove .Mail in above formula, I get an error message. 

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,036)