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

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
BitLord69
Level 10

Re: Filter based on pressed Button

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 filtering 1.pngCheckbox Visa årskurs, top center, not checked, all (fake) students are displayedCheckbox filtering 2.pngCheckbox 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
BitLord69
Level 10

Re: Filter based on pressed Button

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 filtering 1.pngCheckbox Visa årskurs, top center, not checked, all (fake) students are displayedCheckbox filtering 2.pngCheckbox 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 Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

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.

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,240)