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

How to filter gallery list based on button click

Hi everyone, I have created a Claims Management mobile based application using powerapps that collects the data to Sharepoint list. The problem that im facing right now is the filtering part where i have to filter my gallery list based on button click. I want my gallery list to show the claim request based on the claim type which is(Transportation, Phone Bill and Medical) and also all(means all my 3types of claim together) but i've failed to do so. I have a problem in displaying all my claims but i could view if each of the claim type is selected. I have attached the screenshot of the nessecary information screen. How do i get this right? Can anyone help me with this? All help will be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
panand99
Level 8

Re: How to filter gallery list based on button click

Hey @ViknishSatha 

 

You can create a local variable on each button click - UpdateContext({varSelection:Transportation})

and on Screen OnStart- UpdateContext({varSelection:ALL})

and then on gallery items: 

 

if(varSelection="ALL",Requests,filter(Requests,RequestType=varSelection))

 

* Here "Requests" is the sharepoint list

 

Please accept this as a solution if it fulfill your requirement

 

2 REPLIES 2
panand99
Level 8

Re: How to filter gallery list based on button click

Hey @ViknishSatha 

 

You can create a local variable on each button click - UpdateContext({varSelection:Transportation})

and on Screen OnStart- UpdateContext({varSelection:ALL})

and then on gallery items: 

 

if(varSelection="ALL",Requests,filter(Requests,RequestType=varSelection))

 

* Here "Requests" is the sharepoint list

 

Please accept this as a solution if it fulfill your requirement

 

ViknishSatha
Level: Powered On

Re: How to filter gallery list based on button click

Thank you. It works perfectly right now.