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 Supervisor and...
Power Apps
Unanswered

Exclude Supervisor and Direct Reports from People Picker

(0) ShareShare
ReportReport
Posted on by 77

I have been asked to build an app that can only be used by 'peers'. Basically, when selecting a recipient, the choices cannot include myself, my supervisor, nor my direct reports (if I have any). I would like this to be a search box with filtered gallery (forgive me if my terms are not correct!) Basically when user starts typing either a name or email address, the gallery displays people that I can select that match the search.

Any help or links to solutions is appreciated! I've read bits and pieces but I don't understand how to put them together yet. Thanks.

Categories:
I have the same question (0)
  • PaulD1 Profile Picture
    2,914 on at

    Hopefully this can get you started:

    Office365Users.DirectReportsV2( Office365Users.ManagerV2( Office365Users.MyProfileV2().userPrincipalName).userPrincipalName).value.displayName

     You can put this into the Items property of a drop-down.

    It gets your UPN (user principle name), uses that to look up your manager's UPN and then gets all the direct reports for that UPN (your peers).

    Note that Power Apps will throw error messages if the user does not have a manager defined. The only way around that I know is to turn on the experimental setting for 'Formula Level Error Management' but if you do so, thoroughly test the rest of your App as this can change the outcome of existing formulas in your App.

  • TanyaMc Profile Picture
    77 on at

    Thank you. How do I use that as a filter to exclude those names from the choices that appear in the gallery as user types in search box? (I have the search/gallery working just need to exclude ineligible choices.)

  • TanyaMc Profile Picture
    77 on at

    When I tried the code on the gallery, it returns my name and my teammates (same supervisor).
    I need to exclude my supervisor and any direct reports (if I have any)

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard