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

Many checkboxes to filter gallary (SQL Server)

Hello, 

 

I have a tool that should filter people (stored in SQL Server) based on their availability.

As you can see, there are many checkboxes (stored as boolean in the DB) that can be selected to narrow down the search

SalvoTr_0-1656484488402.png

I have looked at so many solutions but was not able to get this to work

 

This is the database:

SalvoTr_1-1656484943769.png

 

Thank you for your help

 

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @SalvoTr ,

 

Please try:

Filter(
  YourDataSource,
  first_name=TextInput.Text &&
  avail_mo=If(MoCheckBox.Value,1,0) &&
  avail_tu=If(DiCheckBox.Value,1,0) &&
  avail_we=If(MiCheckBox.Value,1,0) &&
……
)
  

 

Best Regards,

Bof

Hi @v-bofeng-msft 

 

I greatly appreciate your help.

 

I tried both of these codes and none will work for some reason and I don't understand why.

The gallary simply remains empty. 

Filter(
mafo_interview_contacts;
avail_mo=If(Montag_Checkbox.Value;true;false) ||
avail_tu=If(Dienstag_Checkbox.Value;true;false) ||
avail_we=If(Mittwoch_Checkbox.Value;true;false) ||
avail_th=If(Donnerstag_Checkbox.Value;true;false) ||
avail_fr=If(Freitag_Checkbox.Value;true;false) ||
avail_morning=If(Morgen_Checkbox.Value;true;false) ||
avail_noon=If(Mittag_Checkbox.Value;true;false) ||
avail_afternoon=If(Nachmittag_Checkbox.Value;true;false) ||
avail_evening=If(Abend_Checkbox.Value;true;false)
)


Filter(
mafo_interview_contacts;
avail_mo=If(Montag_Checkbox.Value;true;false) &&
avail_tu=If(Dienstag_Checkbox.Value;true;false) &&
avail_we=If(Mittwoch_Checkbox.Value;true;false) &&
avail_th=If(Donnerstag_Checkbox.Value;true;false) &&
avail_fr=If(Freitag_Checkbox.Value;true;false) &&
avail_morning=If(Morgen_Checkbox.Value;true;false) &&
avail_noon=If(Mittag_Checkbox.Value;true;false) &&
avail_afternoon=If(Nachmittag_Checkbox.Value;true;false) &&
avail_evening=If(Abend_Checkbox.Value;true;false)
)

 (had to do some necessary adjustments --> semicolon and true/false)

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,239)