cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Resolver III
Resolver III

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
Highlighted
Resolver III
Resolver III

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

Highlighted
Frequent Visitor

Re: Filter with buttons

It worked. Thank you very much.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,228)