I am setting up a dynamic page with a repeater and would like to setup a drop down that filters the results in the repeater to only those with items based on the drop down selection. I add the code below but not getting any results when I change the input on the drop down.
https://www.myspanovus.com/services
import { wixData } from 'wix-data';
export function search_click(event, $w) {
//this filters the dataset using one filter which pulls from serviceType column in my DB table
$w("#dbServices").setFilter(wixData.filter()
.contains("serviceType", $w('#iptServices').value))
.then((results) => {
console.log("dataset is now filtered!");
$w("#listRepeater").data = results.item;
}).catch((err) => {
console.log(err);
});
$w("#listRepeater").expand();
}
Hi Thomas 
I’ve checked your site and the code seems to be working well, one comment on your code, you should use the onChange() event handler instead of the onClick() event handler.
If you need further help please let me know.
Yes, I was just able to figure it out. Thank you!
You’re welcome
If you need help, don’t hesitate to tag me or any Corvid Master 
This looks just like the issue I’m having but I can’t seem to get it to work. Is there some more code missing from the above?
If I post my site link could you please take a look?
Thank you Rinshul.
Apologies for my ignorance, I don’t understand javascript at all.
Correct me if I’m wrong, but your example uses a datepicker, when it’s a dropdown I’m using.
The drop down has 10 ‘dates’, which could just as easily be categories or similar. As this site is multilingual I can’t use a standard datepicker and need to go with manually added dates, eg 21, 22, 23, 24 as the values.
I have added these values to another none-dynamic dataset and tried to reference it but my lack of knowledge really lets me down.
I could build it fine if the dynamic dataset was able to filter using ‘user input’, but as you have pointed out, it is disabled.
My one question is to you.
Do you know how to filter data by code -
If not, then see this post too It has the problem to your solution
https://www.wix.com/corvid/reference/wix-data/wixdatafilter/contains
Not a clue, I will check it out
Thank you
@ahmadnasriya Hello Ahmad, I checked out @thomasazar 's site and he is able to do the exact functionality I am seeking. I’m not using Velo though, just the regular Wix editor. Is there any way to achieve the same functionality?
I have followed the steps in this article: Filtering Content Based on User Selection | Help Center | Wix.com , including creating separate datasets for filtering by user selection and connecting drop-down choices.
The dropdown menu appears with the correct choices when I publish, but when a selection is made from the dropdown, the repeater is not filtered.
Thank you so much for your assistance!
Hey Thomas can you paste the code you used on your website, cause it looks like it is working fine now.
I have got the same problem but can’t figure it out.
Hi there, I have tried to manipulate this code to work for my site, to no avail. Would you be willing to have a look at the attached to let me know what I’m doing incorrectly? @ahmadnasriya
import { wixData }
from ‘wix-data’ ;
export function search_change ( event , $w ) {
//this filters the dataset using one filter which pulls from dateNumber column in my DB table
$w ( “#dynamicDataset” ). setFilter ( wixData . filter ()
. contains ( “dateNumber” , $w ( ‘#dropdown1’ ). value ))
. then (( results ) => {
console . log ( “dataset is now filtered!” );
$w ( “#repeater1” ). data = results . item ;
}). catch (( err ) => {
console . log ( err );
});
$w ( “#repeater1” ). expand ();
}
@luke26975
So whats exactly the problem in your code-snipet?
As you can see, in the very first code-line, you have a RED underlined code, which tells you, that there is a little issue on the marked position.
By taking a look into the Velo-API-docs, you will find something like this…
import wixData from 'wix-data';
Now the question!
Where is the difference between this example and your code?
import {wixData} from 'wix-data';
Thank you for pointing that out, I have fixed that now. Unfortunately, the code still isn’t working. Any ideas on how to get this running? Your help is much appreciated.
@luke26975
First check if your export event do work…
exportfunction search_change ( event , $w ){console.log(“Search changed”);
If you get → “Search changed” in your console then checkpoint-1 works.
Console-log every single step in your code, like shown in this example and find the error causing code-line, to debug it.
Did you ever figure out a solution to this?