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!!
Solved! Go to Solution.
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 ...)
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:
Best Regards.
Yumia
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.
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 ...)
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:
Best Regards.
Yumia
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.
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?
Hi @ahhollan
What is your dropdown's Items' formula expression?
Dropdown.Items=Office365Users.SearchUser().Department
Then Gallery.Items=Filter(Office365Users.SearchUser({searchTerm:"",top:500}),Department = Dropdown.Selected.Department)
Hope this could be helpful.
Best Regards.
Yumia
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.
Hi @ahhollan
Could you please change the 500 to 2000 to test (as next screenshot shows)?
Best Regards.
Yumia
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?
User | Count |
---|---|
174 | |
115 | |
85 | |
44 | |
41 |
User | Count |
---|---|
238 | |
150 | |
131 | |
77 | |
72 |