Multiple drop down issue

Hello everyone,
I have an issue when displaying data from a collection into a table using drop downs.
The first drop down function is working but the second not:
Thank you in advance !

import wixData from “wix-data”

export function searchbutton_click(event)
{ //Add your code for this event here:
// Runs a query on the “recipes” collection wixData.query(“FindPartner”)
// Query the collection for any items whose “Name” field contains
// the value the user entered in the input element
.contains(“fullNameOrUsername”, $w(" #searchBox “).value)
.find() // Run the query
.then(res => {
// Set the table data to be the results of the query
$w(” #table ").rows = res.items;
}); }

export function dropdown1_change(event) {
//Add your code for this event here:
// Runs a query on the “recipes” collection
wixData.query(“FindPartner”)
// Query the collection for any items whose “Name” field contains
// the value the user selected in the dropdown
.contains(“activity”, $w(" #dropdown1 “).value)
.find() // Run the query .then(res => {
// Set the table data to be the results of the query
$w(” #table ").rows = res.items
});}

export function dropdown2_change(event) {
//Add your code for this event here:
// Runs a query on the “recipes” collection
wixData.query(“FindPartner”)
// Query the collection for any items whose “Name” field contains
// the value the user selected in the dropdown
.contains(“lookingForA”, $w(" #dropdown2 “).value)
.find() // Run the query
.then(res => {
// Set the table data to be the results of the query
$w(” #table ").rows = res.items
});}

Hey there
What do you mean by not working? Does it not filter the table at all or does it filter the table with the wrong items?

If the second drop down code alter your code and make sure the below is in your page and run it.

.then(res => {
      console.log("------DEBUGGER INFO-----");
      console.log(res.items);
      console.log("------DEBUGGER INFO-----");
      $w("#table").rows = res.items
});} 

Look in your developer console for errors or output as the above code should output any hits from the query. If you don’t get any output in the res.items in the developer console the query it self does not return any records and that is the reason it does not work.

Thank you for the answer.
The problem is that for the second drop down and even for the third (because I tried with a third one), the table is not rendering anything as if the functionality is configured to respond to only one drop down. No errors appear in the console log.

@yaya-pel Does the items appear in the console then? If not have you connected the event correctly in the properties panel? So you did not just copy and paste the code and changed to drop down 2 id?

@andreas-kviby No it does not appear in the console and it is well connected.

Even when I change the value of the first dropdown it works and when I change the second it still doesn’t work