Filter = filter.hasSome (see code pls..)

Hello experts,
what am I doing wrong here? I have a #table1 and filter on it with dropdown filter and everything works fine. After that there are 2 label selects and they should pass the filters and hide the fields accordingly. unfortunately this jump from the top label to the bottom label doesn’t work. do you have a hint?

  • why do i lose all filters when i jump to a dynamic page and go back again?
    maybe some help on how to delete all filters?
    thanks a lot
    YULIA32

/////////////////
export function selectionTags13_change(event) {

let selectedTags = $w("#selectionTags13").value;
let filter = wixData.filter().eq("anrede", $w("#dropdownName1").value)

if (selectedTags) {
    
filter =  wixData.filter().eq("anrede", $w("#dropdownName1").value)
filter =  wixData.filter().eq("status", $w("#dropdownName0").value)
filter =  wixData.filter().eq("nationalitat", $w("#dropdownName2").value)
filter =  wixData.filter().eq("verfugbarkeit", $w("#dropdownName3").value)
filter =  wixData.filter().eq("ausbildung", $w("#dropdownName4").value)
filter =  wixData.filter().eq("berufserfahrung", $w("#dropdownName5").value)

filter = filter.hasSome("bundesland1", $w("#selectionTags14").value)

}
  $w('#dataset1').setFilter(filter);

  wixData.query("Team")
    .contains("anrede", $w("#dropdownName1").value)
    .contains("status", $w("#dropdownName0").value)
    .contains("nationalitat", $w("#dropdownName2").value)
    .contains("verfugbarkeit", $w("#dropdownName3").value)
    .contains("ausbildung", $w("#dropdownName4").value)
    .contains("berufserfahrung", $w("#dropdownName5").value)
    .contains("bundesland1", $w("#selectionTags14").value)
        .limit(100)
        .distinct("bundesland1")
.then(res => {
$w("#selectionTags14").options = res.items.map(e => ({label: e, value:e}));
})

} 
let filter = wixData.filter().eq("anrede", $w("#dropdownName1").value)
if (selectedTags) {
filter =  filter.eq("anrede", $w("#dropdownName1").value)
.eq("status", $w("#dropdownName0").value)
.eq("nationalitat", $w("#dropdownName2").value)
.eq("verfugbarkeit", $w("#dropdownName3").value)
.eq("ausbildung", $w("#dropdownName4").value)
.eq("berufserfahrung", $w("#dropdownName5").value)
.hasSome("bundesland1", $w("#selectionTags14").value)

}
 $w('#dataset1').setFilter(filter);

You are and will remain my idol, such a small change, I’ve been trying for 28 hours and your advice solved the problem in 2 minutes. Thanks

Can you tell me why I lose all filters when jumping to a dynamic page? I have a back to search button but all filters are gone :frowning: