cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ire12345
Regular Visitor

Power apps-Filtering data with multiple toggle and checkbox

I have a data table, when toggle and checkbox is not selected, it will show all data, but when user click toggle/checkbox, it will filter and display the data accordingly. I have 3 toggle and 4 checkbox with different condition. Wonder how to write the code for all the condition? Example user can click checkbox1 and toggle1, or all checkbox and toggle, or 3toggle..etc

@

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Hi @Ire12345 

 

Here is below code to filters pv_type, dept, CheckboxA,CheckboxB, CheckboxC and ToggleManualKey(call type=P2)

 

Filter(
    [@call_list],
    Lower(pv_type) = "p2" && Lower(dept) = "sa" && ((!CheckboxA.Value && !CheckboxB.Value && !CheckboxC.Value) || (CALL_LEVEL in ((If(
        CheckboxA.Value,
        "a"
    )) & "," & (If(
        CheckboxB.Value,
        "b"
    )) & "," & (If(
        CheckboxC.Value,
        "c"
    ))))) && (!ToggleManualKey.Value || CALL_TYPE = "P2")
)

 

StalinPonnusamy_0-1635340906027.png

 

 

StalinPonnusamy_1-1635340922889.png

 

 

Please provide sample data for these (CHANNEL_SOURCE, CALL_CLOSED_PERIOD, CALL_OWNER) and expectations/Requirements.


Thanks,
Stalin - Learn To Illuminate

View solution in original post

11 REPLIES 11
Ire12345
Regular Visitor


@Ire12345 wrote:

I have a data table, when toggle and checkbox is not selected, it will show all data, but when user click toggle/checkbox, it will filter and display the data accordingly. I have 3 toggle and 4 checkbox with different condition. Wonder how to write the code for all the condition? Example user can click checkbox1 and toggle1, or all checkbox and toggle, or 3toggle..etc

@

The checkbox and toggle button as in pic. Data source is link to one drive data. User can simply click any toggle/checkbox for filtering data they want. 

StalinPonnusamy
Community Champion
Community Champion

Hi @Ire12345 

 

We can help you with this. Please provide some information.

  • What is your data source? (Sharepoint or SQL or Excel)?
  • All Toggle values are from the same column?
  • All Checkbox values are from the same column?
  • What field/column type?


Thanks,
Stalin - Learn To Illuminate

 

 

1. Datasource from excel in onedrive

2. All toggle value will filter the different column

3.the 4 checkbox filter the same column

4. Column type mostly is single text

StalinPonnusamy
Community Champion
Community Champion

Hi @Ire12345 

 

Set the Items property of the gallery to

Filter(
    [@TableName],
    !Toggle1.Value || Column1 = "Value1",
    !Toggle2.Value || Column2 = "Value2",
    !Checkbox1.Value || Column3 = "C1",
    !Checkbox2.Value || Column3 = "C2",
    !Checkbox3.Value || Column3 = "C3",
    !Checkbox4.Value || Column3 = "C4"
)

 


Thanks,
Stalin - Learn To Illuminate

too bad not working.

StalinPonnusamy
Community Champion
Community Champion

Hi @Ire12345 

 

  • Can you please share the filter query you tried?
  • Send me the column names.

I will try my end and update you

 

Set(filterWaitps,waitPS.Value);
Set(filterManualKey,manual_key.Value);
Set(filterAll,toggleAll.Value);
Set(typeA,CheckboxA.Value);
Set(typeB,CheckboxB.Value);
Set(typeC,CheckboxC.Value);

Filter(
[@call_list],
!filterWaitps || IsBlank(CHANNEL_SOURCE),
!filterManualKey || CALL_TYPE="P2",
!filterAll || (Value(CALL_CLOSED_PERIOD)=0 && !IsBlank(CALL_OWNER)),
!typeA || CALL_LEVEL="a",
!typeB || CALL_LEVEL="b",
!typeC || CALL_LEVEL="c"
)

Ire12345
Regular Visitor

i want to add on , when load the datasource, i want to filter few column like pv_type='p2' and dept='SA', and when user click on any of the toggle/checkbox, it will filter accordingly plus ( pv_type='p2' and dept='SA')

StalinPonnusamy
Community Champion
Community Champion

Hi @Ire12345 

 

Here is below code to filters pv_type, dept, CheckboxA,CheckboxB, CheckboxC and ToggleManualKey(call type=P2)

 

Filter(
    [@call_list],
    Lower(pv_type) = "p2" && Lower(dept) = "sa" && ((!CheckboxA.Value && !CheckboxB.Value && !CheckboxC.Value) || (CALL_LEVEL in ((If(
        CheckboxA.Value,
        "a"
    )) & "," & (If(
        CheckboxB.Value,
        "b"
    )) & "," & (If(
        CheckboxC.Value,
        "c"
    ))))) && (!ToggleManualKey.Value || CALL_TYPE = "P2")
)

 

StalinPonnusamy_0-1635340906027.png

 

 

StalinPonnusamy_1-1635340922889.png

 

 

Please provide sample data for these (CHANNEL_SOURCE, CALL_CLOSED_PERIOD, CALL_OWNER) and expectations/Requirements.


Thanks,
Stalin - Learn To Illuminate

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,935)