Filter gallery values using buttons in power app

Loading

Requirement: Filtered values to display on screen when click on button which is in header.

Create a Power app add gallery to the screen, connect to the sharepoint list. Add Buttons to the screen as shown in below

Gallery- Onselect property-

Sort(Filter('Leave Request','Created By'.Email= User().Email && Switch(varFilterBy, "Pending",(Status.Value="Pending HR Approval")||(Status.Value="Pending Manager Approval"),"Approved" ,Status.Value="Approved","Declined",Status.Value="Declined",true)), Modified, SortOrder.Descending)
OnButton1- All  -OnSelect property- UpdateContext({varFilterBy:""})

On button2- PendingOnSelect propertyUpdateContext({varFilterBy:”Pending”})

On button3- ApprovedOnSelect propertyUpdateContext({varFilterBy:”Approved”})

On button4- DeclinedOnSelect propertyUpdateContext({varFilterBy:”Declined”})

Leave a Reply

Your email address will not be published. Required fields are marked *