Hi
I am very new to this, so please bare with me.
I am creating a website for a modelling agency - currently creating a ‘find my model’ page where the user could filter by dress size and bra size and it would return the models fitting this criteria.
I have used the below code within the defining functions for both dress size and bra size on the event of a click and this is working to return models fitting both criteria.
My issue now is that I want users to have the choice of only selecting dress size and not specifying a bra size. Currently if i select dress size but no bra size the filter doesn’t work (I assume because i have specified dressfilter and brafilter below) so I assume I need some sort of if statement but really not sure.
Any help is appreciated!!
Thanks
let dressValue = $w(“#dressDropdown”).value
let braValue = $w(“#braDropdown”).value
let dressfilter = wixData.filter().eq(“dressSize”, dressValue)
let brafilter = wixData.filter().eq(“braSize”, braValue)
$w(“#dataset1”).setFilter(dressfilter.and(brafilter))