I was able to create a simple code to filter based on a selection tag connected to one value field but instead I want to be able to connect each value in the selection tag to a boolean value. Currently the “meal” value is comprised of Organic, Vegan, and Low-Fat but I want each of the selection tag option to be connected to three boolean values of organic, vegan, and lowFat.
I’ve tried many different ways to no avail so was hoping someone could help me solve this. I’ve posted the current working code below based on a single value.
import wixData from 'wix-data';
$w.onReady(function () {
filterView();
$w("#selectionTags1").onChange( (event, $w) => {
filterView();
});
$w("#dropdown1").onChange( (event, $w) => {
filterView();
});
});
function filterView(){
var mealFilter = $w("#selectionTags1").value
var deliveryFilter = $w("#dropdown1").value
$w("#dataset1").setFilter( wixData.filter()
.hasSome("meal", mealFilter)
.hasSome("mealsPerWeek", deliveryFilter)
)
}