web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SQL Connector gallery ...
Power Apps
Unanswered

SQL Connector gallery filtering with dropdowns, text input, toggle, and checkboxes not filtering

(0) ShareShare
ReportReport
Posted on by

I have a Power App with a SQL connector not Azure SQL. I have gallery which needs to be filtered using multiple fields. I need to filter by dropdowns not comboboxes, text input, toggle, and checkboxes. I was able to get all of the checkboxes to work. However, when I attempt to integrate a dropdown into the filter statement everything breaks. For more context the checkboxes are a category and the dropdowns are a subcategory. So if I select a check box it should filter and show all in the category. But if I select a checkbox and a dropdown it should filter and show the specific category and the sub-category based on the checkbox. I've  also experienced I select a two checkboxes and values from another checkbox which is not checked is showing in the filtered results. I have no way to change the data structure. I've been struggling for weeks.

 

Filter(datasource, datasourcecheckbox = chkbx1, datasourcecheckbox2 = chkbx2, datasourcecheckbox3 = chkbx3, datasourcedd1= dd1.selected, datasource2=dd2.selected, datasourcetext = txtName)

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,963 Moderator on at

    Hi,

     

    Sorry for your struggle. I do realize its hard sometimes to type up a stressful problem but we have a few things to clarify.

     

    1. Can you show the screen please.

    2. Can you clarify are the columns Text? Numbers? etc? as this plays a big part in how it works.

     

    For instance if I am filtering by checkboxes I expect its against a true/false or yes/no boolean column

    Dropdowns can be text, or choices or even records.

     

    So I need more clarity but usually its like this.

    NOTE:  In the code I am NOT saying type the OR, I am saying depending on your data type, you have 3 options for what DD1 or DD2 has to be typed in.

     

    Filter(DataSource,
     DCheckBox1 = CheckBox1.Value && 
     DCheckBox2 = CheckBox2.Value && 
     DCheckBox3 = CheckBox2.Value && 
     DataSourceDD1 = DD1.Selected OR DD1.Selected.Value OR DD1.Selected.Text &&
     DataSourceDD2 = DD2.Selected OR DD2.Selected.Value OR DD2.Selected.Text &&
     DText = TextInput.Text
    )

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

     

     

  • mjackson122 Profile Picture
    on at

    2. All of the columns are text type. Note in the data source for the checkbox values it is looking for a "1" to indicate it checked. It is not a boolean.  The drop downs are looking for letter values in the data source.

     

    For the checkboxes I have a variable set for oncheck to Set(varch7Checked,"1") and for uncheck I set it to Null. I have this for every checkbox.

    PXL_20230925_132016077.jpg
    PXL_20230925_132409145.jpg
  • Michael E. Gernaey Profile Picture
    53,963 Moderator on at

    Hi,

     

    I would not use variables for that. I would then make it like this.

     

    Filter(DataSource,
     DCheckBox1 = If(Checkbox1.Value = true, "1", Blank()) && 
     DCheckBox2 = If(Checkbox2.Value = true, "1", Blank()) &&
     DCheckBox3 = If(Checkbox3.Value = true, "1", Blank()) && 
     DataSourceDD1 = DD1.SelectedText &&
     DataSourceDD2 = DD2.SelectedText &&
     DText = TextInput.Text
    )

     


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 834

#2
Valantis Profile Picture

Valantis 533

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard