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 / Filter in combobox (pe...
Power Apps
Answered

Filter in combobox (people picker) by user department

(0) ShareShare
ReportReport
Posted on by 576

I have a form with a field for submitter that uses o365 to prefill user name. I have another field that is a combobox tied to a SP people picker column. I would like to filter the second field to show only people in the same department as the submitter. How do I do that with filtering and office365 search user? Below is what I have and it isn't returning correct choices.

 

Filter(
Office365Users.SearchUserV2({Top: 500}).value,
OfficeLocation = Label40.Text
)

Categories:
  • PowerRanger Profile Picture
    3,458 Super User 2024 Season 1 on at

    @ahhollan you say it does not return the correct choices...so what does it return? What is in Label40?

  • ahhollan Profile Picture
    576 on at

    I've altered my formula to use Office365 values to filter against officelocation.  However, i get the Expected Record value error.

    Filter(
    Office365Users.SearchUserV2({Top: 500}).value,
    OfficeLocation = Office365Users.MyProfile().OfficeLocation
    )

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @ahhollan ,

     

    Your formula is correct, however, I think you have set this formula in wrong place. It should be located in the Items property of the Combo box/Dropdown.

     

    Best regards,

     

     

  • Akser Profile Picture
    1,546 Moderator on at

    In short, 'Search User' will search the first 100 records in your Active Directory (you can extend the result set to look for up the first 999 records but that's it).  The alternative is the SearchTerm option however SearchTerm will only look at certain AD columns (display name, given name, surname, mail, mail nickname, and user principal name) so no location. 

     

    If you have Azure AD groups per office location you could use the AzureAD connector instead? 'Get Group Members' - so potentially if your groups had specific location names eg SydneyUsers - you could get that group, pull into a collection and present them?

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard