cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

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
Community Support

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
Highlighted
Regular Visitor

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
Community Support

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

Highlighted
Helper V
Helper V

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.

Helper V
Helper V

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?

Highlighted
Community Support
Community Support

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

Highlighted
Helper V
Helper V

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.

Highlighted
Community Support
Community Support

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

 

Highlighted
Anonymous
Not applicable

Re: Filter by text box or drop down

Hi @ahhollan how are you progressing with this? 

 

@Anonymous 

Highlighted
Helper V
Helper V

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,331)