cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Tamras 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
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
Tamras 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.'

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

Tamras 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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

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