cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

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
Highlighted
Community Support
Community Support

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
Kudo Kingpin
Kudo Kingpin

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.'

Highlighted
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."

Highlighted
Community Support
Community Support

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
Kudo Kingpin
Kudo Kingpin

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,617)