cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Highlighted
panand99
Level 10

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
Highlighted
panand99
Level 10

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. 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 48 members 4,545 guests
Please welcome our newest community members: