I finally got it working. But how can I add a second and a 3rd filter?
I’m almost there ![]()
$w.onReady(function () {
$w('#UserTags').onChange(event => {
let value = event.target.value;
if(value.length){
value = value.reverse()[0];//here you keep only the value f the last selection.
$w('#UserTags').value = [value];
//here you update the selection tags value
}
//then run the filter with the value by calling the runFilter() function
})
});
/**
* Adds an event handler that runs when an input element's value
is changed.
[Read more](https://www.wix.com/corvid/reference/$w.ValueMixin.html#onChange)
* @param {$w.Event} event
*/
export function UserTags_change(event) {
let filter = wixData.filter();
const userType = $w('#UserTags').value;
if(userType.length){
filter = filter.eq('userType', userType[0]);
}
$w('#FAQdataset').setFilter(filter);
}