web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Exclude specific staff...
Power Apps
Answered

Exclude specific staff from a direct reports gallery

(0) ShareShare
ReportReport
Posted on by 351

I have a simple direct reports gallery created by setting the following variable:

Set(vardirectreport1,First(Office365Users.DirectReportsV2(varcurrentuser).value));

And then using this in the gallery Items:

Office365Users.DirectReportsV2(vardirectreport1.mail).value

I would like to be able to exclude specific staff listed in the direct reports gallery. I know the names of the staff I want to exclude (eg. "John Doe", "Jane Doe" etc) and I understand that I would need to use the filter function but I am just not quite sure how to put these 2 things together into a formula.

How could I achieve this?

Categories:
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Power_Automater ,

     

    Please try this:

    Filter(Office365Users.DirectReportsV2(vardirectreport1.mail).value,displayName<>"John Doe",displayName<>"Jane Doe")

     

    Best Regards,

    Wearsky

  • Power_Automater Profile Picture
    351 on at

    Perfect thank you.

    Can I ask, if I needed to reverse this in the future and only need to include "John Doe" and "Jane Doe" and exclude everyone else would this be easy to change in the formula you have provided above?

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Power_Automater ,

     

    This formula will help you

    Filter(Office365Users.DirectReportsV2(vardirectreport1.mail).value,displayName="John Doe"||displayName="Jane Doe")

     

    Best Regards,

    Wearsky

  • Power_Automater Profile Picture
    351 on at

    Thank you, I had everything right except the "||" instead of the "," and couldn't work it out 👍

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard