Dataset Setfilter for Image not empty

I am working with a large collection and I would like to retrieve only items with an image field not empty. Here is my code.

if ( $w ( ‘#checkbox1’ ). checked &&! $w ( ‘#checkbox2’ ). checked ){

$w ( "#dataset1" ). setFilter (  wixData . filter () 

. eq ( “fabricPattern” , “Solid” )
. and (
wixData . filter ()
. eq ( “image” , ! null )
)
)
}
There could be an error in the way I am writing the checkbox condition too. Any help will be appreciated.

Hello. My first question is what is happening now? Do you know if you are making it into your if condition? If you are not sure how that is evaluating you can place a console.log(“true”) just inside and see if it ever gets triggered

Secondly, to check the null, have you tested using isNotEmpty and restructuring your query to get rid of the and. Something like this…

.eq("fabricPattern", "Solid")
.isNotEmpty("image")

That worked, Amanda!