Hey,
I have some problems with my filter. The filter shows 2 wrong results, if I have only checked 1 checkbox. If I check 2 checkboxes, it works without problems.
import wixData from 'wix-data';
export function button(event) {
filter();
}
function filter() {
let filter = wixData.filter();
let check = $w("#checkbox1).checked || $w("#checkbox2").checked || $w("#checkbox3").checked;
if (check) { filter = filter.eq("boolean1", $w("#checkbox1").checked)
.or(filter.eq("boolean2", $w("#checkbox2").checked))
.or(filter.eq("boolean3", $w("#checkbox3").checked)); }
$w('#dataset1').setFilter(filter);
}
Hope you can help me 
What “wrong results” are you getting with only 1 checkbox? What do you expect to get? And what are you in fact getting?
When I check checkbox1 and checkbox2 , I get all results, that have checked boolean1 or boolean2 in the database. That works.
But if I only check checkbox1 , I get all results from boolean1 and two random results.
@nickoertel Have you checked the appropriate boolean fields in your database? Do those fields have valid values? This appears to be more of an issue with your data, and not so much a code problem.
@yisrael-wix Yeah, I already checked the database and all values are valid.
I think it’s a code problem, here a little example:
Code 1:
When I check checkbox1 I get 4 correct results and 2 wrong results.
if (check) { filter = filter.eq("boolean1", $w("#checkbox1").checked)
.or(filter.eq("boolean2", $w("#checkbox2").checked)); }
Code 2:
When I check checkbox1 here I get 4 correct results and no wrong results.
if (check) { filter = filter.eq("boolean1", $w("#checkbox1").checked); }
I really, really hate it when I’m stupid. As much as I was staring at your code I just didn’t see it. And then… Well, you want something like this:
$w("#dataset1").setFilter( wixData.filter()
.eq("boolean1", $w("#checkbox1").checked)
.or(
wixData.filter()
.eq("boolean2", $w("#checkbox2").checked)
)
.or(
wixData.filter()
.eq("boolean3", $w("#checkbox3").checked)
)
)
.then( () => {
console.log("Dataset is now filtered");
} )
.catch( (err) => {
console.log(err);
} );
I hope this help. The only thing that can help me now is a beer.
Hey,
I hope the beer was good 
Thanks for you help and for your time.
I tried your code, but I still have the same problem.
When I set the filter in “checkbox1” I get 7 filtered results.
For example, here we see the hotel “Der Löwe”
But in the database the checkbox for this hotel isn’t checked.

I really don’t know why I get 2 wrong results. The database is ok and the code, too.
And your code is the only one, that runs on the page, so the problem can’t be caused by another code.
OK, so the beer didn’t help, so I had no choice but to write a quickie example. I wanted to be sure that I wasn’t talking nonsense, and that I understood your problem. Take a look at the Multi Boolean Select example.
I hope that’s what you’re trying to do.
Yeah, it’s just a little bit different.
Your code has all checkboxes checked, mine has none selected.
To understand my problem:
Imagine you select bool3 on your code, then you see all results with bool3 selected and number “one” and “two”, although the checkboxes in bool3 aren’t checked.
@nickoertel My example starts with all the checkboxes checked, but you can check and uncheck.
If I select only bool3, I see all items that have bool3 set to true in the database:
I suspect that perhaps we’re not speaking the same language.
@yisrael-wix If you select “bool2” you can see “four, five, six, ten” as results.
When I use your code on my page I can see “four, five, six, ten” and “eight, nine”.
But I don’t want to see “eight, nine” because they don’t have the checkbox “bool2” checked.
And don’t know why I can see them.

I added eight and nine with Photoshop, with your code everything is ok 
But then you can understand my problem better.
@nickoertel You must have something else which is causing this issue. Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.
@nickoertel To be honest, you’ve got a lot of code and many database fields, so it’s not easy to see what’s going on. However, there are some things I should point out:
This is how I create the or condition:
.or(
wixData.filter()
.eq("boolean2", $w("#checkbox2").checked)
)
However, you are doing incorrectly like this:
.or(
filter()
.eq("boolean2", $w("#checkbox2").checked)
)
You have an error in your code (circled in red) which will prevent it from running correctly:
You don’t just have the boolean conditions as filters, but rather you have a number of other conditions (also with incorrect or conditions) that I really don’t know how it affects the filter.
If, as you state, my code is OK, then I would recommend starting with my code, and then adding on a little piece at a time, testing as you go.
I would suggest reviewing the WixDataFilter API for more details.
@yisrael-wix Thanks, but I think the problem is something different.
Please look again at the page “Code Bug Test”.
I used exactly your code and still have the same problem.
@nickoertel I just don’t understand the problem. You say that the code in my example works the way it should, but not in your site. So, you need to start with that and build on it. It is unlikely that there is a bug in the Wix database.
Please understand that this forum is not a support site, and that we are really unable to debug or rewrite complex code and page configurations. If you feel that there is a bug in Corvid, then please try to create a test page with the minimum scenario in which the problem can be clearly identified in order to help us investigate the issue properly.
You may want to check out the Wix Marketplace - it’s a place where you can look for Corvid experts for hire.
@yisrael-wix Thanks for your help.
I’ll make a testpage and ask the Wix support.
I don’t think a Corvid expert can help me, if your codes causes the same problem.
Is there any other setting, that can cause the problem ? Because, how you see, the code and the booleanfields in the database can’t be the problem.
@nickoertel I thought you said that my code works.
Create a simple, minimum scenario that clearly shows the problem. Make sure that the database and the screen elements are as simple and basic as possible. When it’s ready, feel free to post it here and I’ll take a look. I’ll send it to QA for evaluation if it can be shown to be a bug.
@yisrael-wix Hey,
good news, I found the bug. It’s an error in the database. I would say an error caused by Wix.
If I convert the boolean fields into text fields this shows up:

The last one is “false” and that’s why I have this error.
The problem is, that Wix automatically writes this text in every new boolean field I create.
So the only way to fix this, it to delete the entry and make a new one, just deleting “false” is useless.
The problem is, that I can’t change the create time…
Is there any way to change the create date ? Or to sort by another create date field ?
Hey @nickoertel , good catch. Was the collection imported? Or did you convert the field from text to boolean?
I’m going to pass this on to the Database team for evaluation.
Thanks.