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

Filter with buttons

Hi everyone,

 

Is it possible to filter a database using a button?

I am trying to build an app where I can filter the same database in different ways by clicking on different button.

Is it possible?

1 ACCEPTED SOLUTION

Accepted Solutions
xzDan
Level 8

Re: Filter with buttons

Off the top of my head:

Button1.OnSelect:

UpdateContext({FilterMode: 1})

Button2.OnSelect:

UpdateContext({FilterMode: 2})

 

Database Items:

If(FilterMode = 1, Filter(<Source>,<Condition1>),
FilterMode=2, Filter(<Source>,<Condition2>),
...
)

Or you can have the onselects add values etc to allow for multiple filters, or just multiple Contexts to handle multiple selections

View solution in original post

2 REPLIES 2
xzDan
Level 8

Re: Filter with buttons

Off the top of my head:

Button1.OnSelect:

UpdateContext({FilterMode: 1})

Button2.OnSelect:

UpdateContext({FilterMode: 2})

 

Database Items:

If(FilterMode = 1, Filter(<Source>,<Condition1>),
FilterMode=2, Filter(<Source>,<Condition2>),
...
)

Or you can have the onselects add values etc to allow for multiple filters, or just multiple Contexts to handle multiple selections

View solution in original post

daniromero
Level: Powered On

Re: Filter with buttons

It worked. Thank you very much.

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

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 (9,575)