When I only run the first filter → every think is fine.
When I only run the second → every think is fine.
When I first and then the second → second overwrite the first filter.
Question: How can I run both filters together with a “and-compination” ?
Hi,
Setting a dataset’s filter overrides existing filters that were previously set using the setFilter() function or using the Dataset Settings panel in the Editor. See here .
You need to either set both filters using data binding or using code. When using code you can use and() condition. See here .
I assume by what you are looking at achieving you have a dynamic database on the page, and trying to set the second dataset by both the first database and the coded variable if so as per Aleks answer you need to code both into it. See below;
import wixData from 'wix-data';
$w("#dynamicDataset").onReady(() => {
let dynamicID = $w("#dynamicDataset").getCurrentItem()._id
let filter = wixData.filter()
.hasSome("column", [dynamicID])
.between("platze", kapaFrom, kapaTo + 1);
$w("#dataset2").setFilter(filter)
})
Thank you for the answer, if I should code both quiries thats fine for me. But can you pleas answer the question, how can I set a filter to a referenced field with multiple items?