cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SalvoTr
Frequent Visitor

Filter Gallery with multiple Checkboxes (boolean)

Hi, 

 

I have an App that stores potential Interviewees in a MS SQL Server database.

In the SQL database we collect peoples' names and their availability (which day of the week & during which time of the day --> as booleans

 

Now, I represent the data in a Gallery & want to filter people using a searchbar (which already works).

However, I am stuck at the following:

- The database has 9 boolean values (avail_monday, ..., avail_friday, avail_morning, ..., avail_evening)

- I want to have a checkbox for each weekday & each time-range (e.g. morning, noon,..) so that it filters exactly what person is when available

 

I have tried a lot of possibilities but I haven't figured it out

Also wanted to try with a combobox but I don't know how I would implement it..

 

SalvoTr_0-1656051673532.png

this does not work (and neither with "And")

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @SalvoTr ,

 

The logic for your scenario will quite complicated if you think with a positive mindset, but imagine think with the negative mindset, that is, to exclude items those not meet the checked values, things seemed to be more clear.

 

So the function would be:

Filter(
    SQLTable, 
    If(
        Montag_Checkbox.Value = true, 
        Not(avail_mo = false)
    ) && 
    If( 
        Dienstag_Checkbox.Value = true, 
        Not(avail_tu = false)
    ) && 
    If(
        Mittwoch_Checkbox.Value = true, 
        Not(avail_we = false)
    ) && 
    ...
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

5 REPLIES 5
NurSabrina24
Helper I
Helper I

Hi, 

 

Sorry, but could you provide some screenshots for the steps of your app. Few pictures might help you if they understand from your picture. 

SalvoTr
Frequent Visitor

This is what the gallary looks like: 

SalvoTr_0-1656054041099.png

I want these Checkboxes to be functional (they are currently not) 

 

For instance, if I check the box "Montag" I want to see all people that are available on monday (--> all entries in the SQL database that have avail_mo=true)

Hi Sabrina, I replied to my comment with a screenshot. Hope it's clearer 🙂

NurSabrina24
Helper I
Helper I

Hi,

How about you try to follow these two or either one? It kind of similar to yours..

 

Filter gallery through checkboxes - Power Platform Community (microsoft.com) 

or this,

Solved: Filter Gallery from multiple checkbox - Power Platform Community (microsoft.com)

 

post - credit to owner 

 

v-jefferni
Community Support
Community Support

Hi @SalvoTr ,

 

The logic for your scenario will quite complicated if you think with a positive mindset, but imagine think with the negative mindset, that is, to exclude items those not meet the checked values, things seemed to be more clear.

 

So the function would be:

Filter(
    SQLTable, 
    If(
        Montag_Checkbox.Value = true, 
        Not(avail_mo = false)
    ) && 
    If( 
        Dienstag_Checkbox.Value = true, 
        Not(avail_tu = false)
    ) && 
    If(
        Mittwoch_Checkbox.Value = true, 
        Not(avail_we = false)
    ) && 
    ...
)

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,327)