Hi,
I’m trying to do a simple filter on my dataset where I have 3 dropdown (Game, Session Type and Cost)
I would like the user to be able to search by one or all of the options to return results matching the query.
With cost, user can search for <£15, £15 - £25 and £25>) and I’m trying the following code but it is not working?
Am I missing something?
export async function btnFindCoach_click(event, $w) {
let filter = wixData.filter();
let game = $w("#ddGame").value;
let sessionType = $w("#ddSessionType").value;
let cost = $w("#ddCost").value;
if (game) {
filter = filter.contains("games", game);
}
if (sessionType) {
filter = filter.contains("sessionType", sessionType);
}
if (cost === "0") {
filter.between("houlyRate", 0, 15)
} else if (cost === "15") {
filter.between("houlyRate", 15, 25)
} else if (cost === "25") {
filter.ge("houlyRate", 25)
}
$w("#dynamicDatasetCoaches").setFilter(filter);
console.log(game, sessionType, cost);
}
Thanks,
Rachel