cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahhollan
Level: Powered On

Filter by text box or drop down

I'm very new to Power Apps. I'm connected to our Office 365 users connector. I've built an ee directory and am trying to set it up so that i can filter the list by either a user name in a text box OR a drop down list of departments.  I'm not sure how to do this. Do I create the filter on the Gallery filter? if so, what is the syntax? Please help!!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Filter by text box or drop down

Hi @ahhollan 

 

You can reference @ahhollan 's suggestions.

Add one Gallery control, one textinput control,and rename the control as Gallery3, Textinput1

Gallery3.Items=Filter(Office365Users.SearchUser(),DisplayName = TextInput1.Text)    (you can use DisplayName and other properties as Id,Title ...)

textinput1.PNG

And if you want to use one dropdown control.

Dropdown.Items=Office365Users.SearchUser().DisplayName

Gallery.Items=Filter(Office365Users.SearchUser(),DisplayName = Dropdown.Selected.DisplayName)

 

More information:

control-gallery

function-filter-lookup

control-text-input

control-drop-down

 

Best Regards.

Yumia

View solution in original post

9 REPLIES 9
Ritika_Agarwal
Level: Powered On

Re: Filter by text box or drop down

Hi @ahhollan 

Yes, you can directly reference the filtered results into the Gallery Items. For doing so, please use the below expression and you should be able to get the required result.

Filter(Office365Users.SearchUser(),Or(TextInput4.Text in DisplayName, Dropdown1.Selected.Value in Department))

Here I have used the Office365Users.SearchUser() to get the details from the data source for the selected DisplayName/Department.


I hope this will resolve your concern! If yes, please mark it as closed, so that it will be beneficial for others too.

Highlighted
Community Support Team
Community Support Team

Re: Filter by text box or drop down

Hi @ahhollan 

 

You can reference @ahhollan 's suggestions.

Add one Gallery control, one textinput control,and rename the control as Gallery3, Textinput1

Gallery3.Items=Filter(Office365Users.SearchUser(),DisplayName = TextInput1.Text)    (you can use DisplayName and other properties as Id,Title ...)

textinput1.PNG

And if you want to use one dropdown control.

Dropdown.Items=Office365Users.SearchUser().DisplayName

Gallery.Items=Filter(Office365Users.SearchUser(),DisplayName = Dropdown.Selected.DisplayName)

 

More information:

control-gallery

function-filter-lookup

control-text-input

control-drop-down

 

Best Regards.

Yumia

View solution in original post

ahhollan
Level: Powered On

Re: Filter by text box or drop down

I've altered the formula to Filter(Office365Users.SearchUser(),Or(InputEE.Text in DisplayName, Dropdown1.Selected.Value in Department)) .  However, when I test the app, I get no returned values. I placed the filter on Gallery>Items.

ahhollan
Level: Powered On

Re: Filter by text box or drop down

I've updated the formula to Filter(Office365Users.SearchUser({searchTerm:"",top:500}),Department = Dropdown1.Selected.Result).  I now get a result, but only one record. How do I change this to get all people in the selected department?

Community Support Team
Community Support Team

Re: Filter by text box or drop down

Hi @ahhollan 

 

What is your dropdown's Items' formula expression?

Dropdown.Items=Office365Users.SearchUser().Department

DropDown.PNG

Then Gallery.Items=Filter(Office365Users.SearchUser({searchTerm:"",top:500}),Department = Dropdown.Selected.Department)

Gallery.PNG

 

Hope this could be helpful.

 

Best Regards.

Yumia

ahhollan
Level: Powered On

Re: Filter by text box or drop down

I think my issue is in the number of rows limitation for non delegatable query functions. When I enter the limiter of top:500,  i get results, but very limited.  I'm thinking that it's only processing the first 999 rows and I can't get around the limitation. Please advise if you've found a way to get around this.

Community Support Team
Community Support Team

Re: Filter by text box or drop down

Hi @ahhollan 

 

Could you please change the 500 to 2000 to test (as next screenshot shows)?

Top500.PNG

 

Best Regards.

Yumia

 

TopShelf-MSFT
Level 10

Re: Filter by text box or drop down

Hi @ahhollan how are you progressing with this? 

 

@TopShelf-MSFT 

ahhollan
Level: Powered On

Re: Filter by text box or drop down

I've been able to get the formula to return results. The problem is that even when I change the formula to look at the top 2000 rows, it still isn't reviewing the entire database which has approx. 12k rows. Is there a way around this?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,255)