@ffvii-serie-memorabi Sorry about that. Reason why it doesnt work for selecting both cases is because it falls into the if statements.
Below should work, but there is a lot of duplicate code. We should go for a DRY(Dont Repeat Yourself) approach when coding.
Let me know if you have any other questions. Thanks!
if ($w("#dropdown1").value && $w("#dropdown2").value ) {
// Query for both.
wixData.query("VideoAll")
.eq("origin", String($w("#dropdown1").value))
.and(wixData.query("VideoAll").contains("classification", String($w("#dropdown2").value)))
.find()
.then(results => {
$w("#Badgerepeater").data = results.items;
});
} else if ($w("#dropdown2").value) {
// Query 'classification' only when #dropdown2 is filled
wixData.query("VideoAll")
.eq("classification", String($w("#dropdown2").value))
.find()
.then(results => {
$w("#Badgerepeater").data = results.items;
})
} else if ($w("#dropdown1").value) {
// Query 'Origin' only when #dropdown1 is filled
wixData.query("VideoAll")
.eq("origin", String($w("#dropdown1").value))
.find()
.then(results => {
$w("#Badgerepeater").data = results.items;
})
} else {
// Error case
}