I have searched and tested code several different ways and cannot get this to work. Every way I try to implement code, I am not seeing any filtered results… It only shows all data. I could really use some guidance in either setting up components differently or needing more code. Any input is helpful!! I am newer to code but understand the basics.
Since I have been testing so many different ways to code this, I currently have code for my first dropdown #StateDropdown and would like it to update results onChange. I have a second dropdown #TypeDropdown and would like end users to use both, one, or none to filter.
Current code (again just to test if it’ll work for the first dropdown):
import wixData from ‘wix-data’;
export function StateDropdown_change(event) {
//Add your code for this event here:
}
wixData.query(“PMR_Dog_Database”)
// Query the collection for any items whose “State” field contains
// the value the user selected in the dropdown
.eq(“state”, $w(“#StateDropdown”).value)
.find() // Run the query
.then(res => {
$w("#DogResults").data = res.items;
});