Problem with collection

@jonatandor35 No the Filter is only for the Categoria that is related to #dropdown1 my problem in this code is that i can’t filter for the dropdown, only i can search the nombrerelato.
I fixed the code for some keynotes error but now the only think i need is to add the drop down filter.
this is the code i have now with out errors but not working the dropdown filtering.

import wixData from “wix-data”

$w.onReady(() => {
loadCategoria();
});

let lastFilterNombrerelato;
let lastFilterCategoria
let debounceTimer;
export function Irelato_keyPress_1(event, $w) {
if (debounceTimer){
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
filter($w(‘#Irelato’).value,lastFilterCategoria);
}

export function dropdown1_change(event, $w) {
filter(lastFilterCategoria, $w(‘#dropdown1’).value);
}

function filter (nombrerelato, categoria){
if (lastFilterNombrerelato !== nombrerelato || lastFilterCategoria !== categoria) {
let newFilter = wixData.filter();
if (nombrerelato)
newFilter = newFilter.contains(‘nombreDelRelato’, nombrerelato);
if (categoria)
newFilter = newFilter.contains(‘categoria’, categoria)
$w(‘#dataset1’).setFilter(newFilter);
lastFilterNombrerelato = nombrerelato;
lastFilterCategoria = categoria;
}
}

function loadCategoria (){
wixData.query(‘ParticipantesConcurso’)
.distinct(“title”)
.then((res) => {
let categories = res.items;
let options = categories.map(c => { return {“label”: c, “value”: c}});
$w(“#dropdown1”).options = options;
})
}