I have seen various questions on choice fields and specifically how to show all records with the option to apply multple filters - and then show all again.
The underlying SharePoint table has a single line Title text field and includes two Choice fields, Region and Sector.
The aim is to filter on each choice field item via dropdowns and refine with partial text matches from the Title field.
The following code achieves the filtering but I cannot see how to show all.
(Filter(RiskList,ReadRegion = Dropdown1.Selected.Value, ReadSector = Dropdown3.Selected.Value, TextSearchBox1.Text in Title),
The dropdown controls (Data, Items) are linked to the table choices - as in Distinct(RiskList,ReadRegion).
Note 1: ReadRegion and ReadSector are calculated fields derived from the Choice fields which, I've seen from other posts, seems to be a necessary workaround due to limitations on direct use of choice fields.
Note 2: I have seen the 500 record limitations on Distinct and SortByColumns - this is not an issue for this list.
I guess one way to show all Regions/all Sectors would be to have a Clear button and then use an If function ahead of the filter. But that's not very pretty! Ideally an ALL option could be included in the Choice dropdown in the app but I cannot see how to add that to the choices derived from the table.
I'm a newcomer to the SharePoint/PowerApps platform but am impressed by the possibilities and would appreciate any suggestions. I have seen some other posts on this topic but none as yet seem to have resolved this scenario.
Would you please help to describe more about "the code achieves the filtering but I cannot see how to show all." part? Did you mean that this formula would show part of the list items but not show all the items that matches the condition?
About the limitation of filter function on Choice column, here is one workaround you could try:
Also, did you get blue dot suggestion saying that there is a service limitation when using the formula?
For your reference about the blue dot:
I think the peters.com link references a case where the app is intended to only show the items that are the responsibility of a particular user. So the "always on" filtering is perfect for that.
Yes, I get the blue dot warning and have noted the delegation issue. Not a problem for this app.
In response to your question about the intention, imagine an app with a choice field, Region, that offers these options as a single choice:- Asia, Middle East, Europe, Africa, Americas.
The code in my example works fine to filter by one selected Region - but I would also like to show all Regions.
Many thanks, C
Fill out a quick form to claim your user group badge now!
Find out where you can attend!
Features releasing from October 2019 through March 2020
Learn how to build the business apps that you need.