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

Choice fields - show all choices in app

Hi all,

 

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.

 

SortByColumns
(Filter(RiskList,ReadRegion = Dropdown1.Selected.Value, ReadSector = Dropdown3.Selected.Value, TextSearchBox1.Text in Title),
"MRL",SortOrder.Descending)

 

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.

 

Thanks,

C

3 REPLIES 3
Community Support Team
Community Support Team

Re: Choice fields - show all choices in app

Hi @chahgllp,

 

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? 

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: Choice fields - show all choices in app

Hi @chahgllp,

 

About the limitation of filter function on Choice column, here is one workaround you could try:

https://www.peters.com/powerapps-filter-sharepoint-list-items/

 

Also, did you get blue dot suggestion saying that there is a service limitation when using the formula?

medium.png

 

For your reference about the blue dot:

https://powerapps.microsoft.com/en-us/tutorials/delegation-overview/

 

Best regards, 

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
chahgllp
Level: Powered On

Re: Choice fields - show all choices in app

Thanks Mona

 

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

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,954)