cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Trying to filter office365 from specific country

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Member

Re: Trying to filter office365 from specific country

Solved, with this code:

 

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

Hadn't used the "in" operator yet.

View solution in original post

2 REPLIES 2
Highlighted
New Member

Re: Trying to filter office365 from specific country

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?

Highlighted
New Member

Re: Trying to filter office365 from specific country

Solved, with this code:

 

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

Hadn't used the "in" operator yet.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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