Hello,
I have a website for our area with a list of services for a particular demographic. The dataset has the resources listed by town. On the website there is one page for town A and one page for town B with a repeater. When the user performs a “search by service” using a dropdown boolean, the results in the repeater show both items from both towns. I can’t seem to code correctly to have the .setFilter be for town A only. Any help is appreciated.
import wixData from ‘wix-data’;
$w(“#listingdataset1”).setFilter( wixData.filter()
.contains(“town”, “Maple”)
);
export function ServiceDropdown_change_1(event) {
let filterService =$w(‘#ServiceDropdown’).value;
$w(‘#listingdataset1’).onReady( () => {
if (filterService === “Education”) {
$w(‘#listingdataset1’).setFilter(wixData.filter().eq(“education”, true ))
}
if (filterService === “Health”) {
$w(‘#listingdataset1’).setFilter(wixData.filter().eq(“health”, true ))
}
)}