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

Filter datatable with checkbox

Hi everyone,

 

I am trying some multiple filters on a datatable with 2 checkboxes. The first checkbox toggles between column "status", showing all statuses or showing only status of projects that are on-going. 

Demo01Dashboard is the SharepointList. So if Checkbox 3 = true it shows all, if its false it shows just a few. This works fine.

Filter(Demo01Dashboard; Checkbox3.Value=true 
And (Status.Value = "Afgerond" Or Status.Value = "Vervallen" Or Status.Value = "Teruggegeven" Or Status.Value = "Inventarisatie" Or Status.Value = "Implementatie" Or Status.Value = "KYC" Or Status.Value = "Afronding" Or Status.Value = "On-Hold" Or Status.Value= "Toe te wijzen")
Or Checkbox3.Value = false And (Status.Value = "Inventarisatie" Or Status.Value = "Implementatie"
Or Status.Value = "KYC" Or Status.Value = "Afronding" Or Status.Value = "On-Hold" Or Status.Value= "Toe te wijzen"))

 Now I want to add an extra filter with checkbox to toggle between your own projects or the projects of the whole team by column "ImpManager".

The column "ImpManager" in the SPlist are e-mail addresses, so I can connect that with a label with the e-mail address in with the current user.

So if I update the formula with:

; CheckboxImpManager.Value=false;ImpManager.Value=LabelEmail.Text)

  It will only show my project when the checkbox is turned off.

 

But now I also have to make a statement on when the checkbox is true and it needs to show all values in column "ImpManager". And there I get lost :).

 

Help much appreciated!

 

Kind regards,

 

Roger Middleton

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Super User II
Super User II

Hi @Rogermiddleton ,

I admire your consistency in filtering data with a single formula 🙂 ... Here is my proposal :

 

 

 

Filter
   (Demo01Dashboard; 
    If(Checkbox3.Value, 
     Status.Value = "Afgerond" || Status.Value = "Vervallen" || Status.Value = "Teruggegeven" || Status.Value = "Inventarisatie" || Status.Value = "Implementatie" || Status.Value = "KYC" || Status.Value = "Afronding" || Status.Value = "On-Hold" || Status.Value= "Toe te wijzen";
     Status.Value = "Inventarisatie" || Status.Value = "Implementatie" || Status.Value = "KYC" || Status.Value = "Afronding" || Status.Value = "On-Hold" || Status.Value= "Toe te wijzen");
   !CheckboxImpManager.Value && ImpManager.Value=LabelEmail.Text
) 

 

 

 

To simplify formula, why don't you use the OnCheck / OnUncheck property of the toggle controls to filter the data and store it in the same collection ?

 

Hope it helps !

View solution in original post

3 REPLIES 3
gabibalaban
Super User II
Super User II

Hi @Rogermiddleton ,

I admire your consistency in filtering data with a single formula 🙂 ... Here is my proposal :

 

 

 

Filter
   (Demo01Dashboard; 
    If(Checkbox3.Value, 
     Status.Value = "Afgerond" || Status.Value = "Vervallen" || Status.Value = "Teruggegeven" || Status.Value = "Inventarisatie" || Status.Value = "Implementatie" || Status.Value = "KYC" || Status.Value = "Afronding" || Status.Value = "On-Hold" || Status.Value= "Toe te wijzen";
     Status.Value = "Inventarisatie" || Status.Value = "Implementatie" || Status.Value = "KYC" || Status.Value = "Afronding" || Status.Value = "On-Hold" || Status.Value= "Toe te wijzen");
   !CheckboxImpManager.Value && ImpManager.Value=LabelEmail.Text
) 

 

 

 

To simplify formula, why don't you use the OnCheck / OnUncheck property of the toggle controls to filter the data and store it in the same collection ?

 

Hope it helps !

View solution in original post

Rogermiddleton
Helper II
Helper II

Thanks @gabibalaban ,

 

Your solution worked! I am quite new at powerapps so sometime getting a bit lost with the formulas :).

 

What did you mean by your last comment by filtering the data and storing it in the same collection? Can I simplify the formula by that?

 

Kind regards,

Roger

@Rogermiddleton ,

I'm glad to hear that ... but taking of second look I updated my formula. Please check it again if this is a good solution for you (unmark it, plase, if is not suitable for you).

There were no need to check for 

 

CheckboxImpManager.Value=true

 

as you want all the values.

My other idea was not quite appropiate for this situation.

 

Thank you !

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (57,707)