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

Filter by multiple buttons

This is probably super easy but.... I am trying to filter a gallery based on 2 variables set by 2 buttons. I also want to sort by date.

 

Datasource: Sharepoint List called: DYW_Coverage_Cal

Variable1: NotCoveredFlag True/False

Variable2: ShowAllRecords: 0/1

 

SortByColumns( If(ShowAllRecords=0, Filter(DYW_Coverage_Cal,'Start Time'>=Today()),DYW_Coverage_Cal); If(NotCoveredFlag=true, Filter(DYW_Coverage_Cal,Coverage_Status.Value="Not-Covered"),Filter(DYW_Coverage_Cal,Coverage_Status.Value="Covered")), ,'Start Time', Ascending)

 

Thanks! Shawn

3 REPLIES 3
Slloyd
Level: Powered On

Re: Filter by multiple buttons

-- SORRY FOR FORMATTING ISSUES ABOVE -- This is probably super easy but....  I am trying to filter a gallery based on 2 variables set by 2 buttons. I also want to sort by date:  Datasource: Sharepoint List called: DYW_Coverage_Cal Variable1: NotCoveredFlag True/False Variable2: ShowAllRecords: 0/1 SortByColumns( If(ShowAllRecords=0, Filter(DYW_Coverage_Cal,'Start Time'>=Today()),DYW_Coverage_Cal); If(NotCoveredFlag=true, Filter(DYW_Coverage_Cal,Coverage_Status.Value="Not-Covered"),Filter(DYW_Coverage_Cal,Coverage_Status.Value="Covered")), ,'Start Time', Ascending) Thanks! Shawn
Community Support Team
Community Support Team

Re: Filter by multiple buttons

Hi @Slloyd ,

 

Could you please explain in detail that what is the conditions and the corresponding results of this formula?

 

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
Slloyd
Level: Powered On

Re: Filter by multiple buttons

Thanks for the reply. This PowerApp is using a SharePoint Calendar as its data source.

1. By default the gallery should only show records who's "Start Time" field is >= to today. 

2. The first button should toggle off the above filter and show all records. This button uses "OnSelect" to set a variable called "ShowAllRecords" 0/1. 

3. The second button sets the variable "NotCoveredFlag" = true/false, which toggles to only show records that are "Not-Covered". It uses the column "Coverage_Status" which has a choice of "Covered" or "Not-Covered". 

 

The formula I posted above goes in the "Items" property for the gallery. I would like the 2 buttons / filters to work independently of each other. 

 

Hope that all makes sense. 

 

Thanks,

Shawn

 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,092)