cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

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

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

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.
Highlighted
New Member

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (3,530)