cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Filter based on pressed Button

I have a very simple question ... I need a dynamic Filter that displays data in a gallery.

If a Button is pressed some entries should dissappear - of it is pressed again - the entries should appear again ...

 

My Filter so far - working great:

 

SortByColumns(Filter(coll_Auftraege;StartsWith(Beschreibung; TextSearchBox1.Text); "AuftragID"; If(SortDescending1; Ascending; Descending))

 

My wish -> I add a filter criteria via && (see below)

This vriteria shall only work, when a Button above my criteria is pressed!

 

SortByColumns(Filter(coll_Auftraege;StartsWith(Beschreibung; TextSearchBox1.Text) && StartsWith(ZustaendigAnzeigename ; user_4.Text)); "AuftragID"; If(SortDescending1; Ascending; Descending))

 

I am sure this is easy - thanks for your help!

 

regards

Didi

1 ACCEPTED SOLUTION

Accepted Solutions
Power Participant
Power Participant

Hi,

 

What you can do with a button is to set a variable that will decide whether you should use the extra filter or not. You ought to have some sort of indicator to show the state of the variable. This could be in a label of its own, or by changing the text and/or colour of the button. 

 

Since you want to toggle the filtering on/off, I'd use a check box myself. That way it's clear to the user what's going on, and it's very easy to implement in the call to Filter without the use of additional variables.

 

Look at the two screen shots from an app currently in development. Here I'm using check boxes to do extra filtering.

 

Checkbox Visa årskurs, top center, not checked, all (fake) students are displayedCheckbox Visa årskurs, top center, not checked, all (fake) students are displayedCheckbox Visa årskurs, top center, checked. To make extra clear it's checked the colour is changed and only the appropriate students are displayedCheckbox Visa årskurs, top center, checked. To make extra clear it's checked the colour is changed and only the appropriate students are displayed

To implement this in your filter you will have to do this:

 

SortByColumns(Filter(coll_Auftraege;StartsWith(Beschreibung; TextSearchBox1.Text) && If(cbYourCheckbox.Value; StartsWith(ZustaendigAnzeigename ; user_4.Text); true)); "AuftragID"; If(SortDescending1; Ascending; Descending))

I put the extra checkbox selection in bold face and hope I got the parentheses correct.Get back to me if something's odd.

 

Good luck!

 

 

 

View solution in original post

1 REPLY 1
Power Participant
Power Participant

Hi,

 

What you can do with a button is to set a variable that will decide whether you should use the extra filter or not. You ought to have some sort of indicator to show the state of the variable. This could be in a label of its own, or by changing the text and/or colour of the button. 

 

Since you want to toggle the filtering on/off, I'd use a check box myself. That way it's clear to the user what's going on, and it's very easy to implement in the call to Filter without the use of additional variables.

 

Look at the two screen shots from an app currently in development. Here I'm using check boxes to do extra filtering.

 

Checkbox Visa årskurs, top center, not checked, all (fake) students are displayedCheckbox Visa årskurs, top center, not checked, all (fake) students are displayedCheckbox Visa årskurs, top center, checked. To make extra clear it's checked the colour is changed and only the appropriate students are displayedCheckbox Visa årskurs, top center, checked. To make extra clear it's checked the colour is changed and only the appropriate students are displayed

To implement this in your filter you will have to do this:

 

SortByColumns(Filter(coll_Auftraege;StartsWith(Beschreibung; TextSearchBox1.Text) && If(cbYourCheckbox.Value; StartsWith(ZustaendigAnzeigename ; user_4.Text); true)); "AuftragID"; If(SortDescending1; Ascending; Descending))

I put the extra checkbox selection in bold face and hope I got the parentheses correct.Get back to me if something's odd.

 

Good luck!

 

 

 

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (31,153)