How do I have 2 dropdown filters interacting with each other?

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))

Do you want something like in this example?
https://www.wix.com/corvid/example/cascading-form

Also note that it will only set your filter for both as you are including both with the ‘and’ in your code.
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html#and

Have a look at this example too.
https://www.wix.com/corvid/example/mega-search