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 / Trying to filter offic...
Power Apps
Answered

Trying to filter office365 from specific country

(0) ShareShare
ReportReport
Posted on by 11

Hi,

I'm trying to set up a filter/search for Office365 users from a specific country or company and display those in a gallery. Is this possible?

 

In this code I'm filtering on country/company/name depending on what radiobutton the user selected (and only if the company name is specified). The first filter works, the country or company filter I can't get to work.

If(Radio1.Selected.Value="Name"; Filter(Office365Users.SearchUser({searchTerm:SearchBar.Text}); Not(IsBlank(CompanyName)));
If(Radio1.Selected.Value="Country"; Filter(NO IDEA HERE({searchTerm:SearchBar.Text}); Not(IsBlank(CompanyName)));
If(Radio1.Selected.Value="Company"; Filter(NO IDEA HERE({searchTerm:SearchBar.Text}); Not(IsBlank(CompanyName))))))

Thanks in advance!

Categories:
I have the same question (0)
  • Evo Profile Picture
    11 on at

    I'm a bit further now, didn't realise it would be this easy:

     

    If(Radio1.Selected.Value="Company"; Filter(Office365Users.SearchUser({searchTerm:""}); CompanyName=SearchBar.Text)))

    But now I only get results when my searchbar contains the exact CompanyName. Can I easily change that so it searches within CompanyName?

  • Verified answer
    Evo Profile Picture
    11 on at

    Solved, with this code:

     

    If(Radio1.Selected.Value="Company"; Filter(Office365Users.SearchUser({searchTerm:""}); SearchBar.Text in CompanyName)))

    Hadn't used the "in" operator yet.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 610

#2
Haque Profile Picture

Haque 317

#3
WarrenBelz Profile Picture

WarrenBelz 315 Most Valuable Professional

Last 30 days Overall leaderboard