code for filtering repeaters

This is my code…

import wixData from ‘wix-data’;
$w.onReady(() => {
$w(“#dataset4”).setFilter(wixData.filter().eq(‘location’,));
});
export function location1_change(event) {
let myValue = $w(‘#location1’).value;
console.log(myValue,“myvalue”)
$w(“#dataset4”).setFilter(wixData.filter()
.eq(‘location’, myValue))
.eq(‘goLive’, “GoLive”)
.eq(‘category’, “Speaker”)
}

I’m using a dropdown box to filter a repeater. I would like the user to be able to select a location and only have profiles come up the are live and in the speaker category. The code works without the bottom 2 lines but brings out profiles that re not live and in other categories. But when I add the 2 .eq lines of the code. It stops working altogether.

I’m not a coder and doing my first DIY job on this. Please help.

You’re trying to write…

$w("#dataset4").setFilter(
	wixData.filter()
		.eq('location', myValue)
		.eq('goLive', "GoLive")
		.eq('category', "Speaker")
);

The whitespace isn’t relevant; the second parenthesis after myValue should have come later.

Thank you for your help, but I’m still having troube.

To give a bit more detail.

I’m using a repeater to show user profile. On this page I have used the repteaters filters only show Speaker Profiles and Profiles that are set to Go Live. The drop down box is use as a search function to serch for Speakers in a set location. At the moment, when a user sections a location from the dropdown box, the repeater bypasses the filters that I have set and the repeater shows the correct selcected location but also shows Profiles in different categorys other then speakers and also shows profiles that are set to Off Line.

As mentioned above, your code has 3 visible bugs.

import wixData from 'wix-data';

$w.onReady(() => {
    $w("#dataset4").setFilter(wixData.filter()
    .eq('location',) //missing value (1)
    ); 
});
export function location1_change(event) {
    let myValue = $w('#location1').value;
    console.log(myValue,"myvalue")
    $w("#dataset4").setFilter(wixData.filter()
    .eq('location', myValue)) //remove extra bracket (2)
    .eq('goLive', "GoLive")
    .eq('category', "Speaker")
    ); //missing bracket and semi colon (3)
}

Can you please change the title of this post? The answers are lost when the title isn’t clear. :frowning: