Search a repeater linked to wixforms database

Hey! I have a repeater that is linked to a database that is provided by user inputs via a wix forms. I used the video tutorial of a search feature that filters the repeater based on a user input. I followed the steps on the video and primarily used their based code and just changed the sources to fit my page. When i run it, the code doesn’t work, it does not do the search and the repeater doesn’t react to it.
Here is a quick video showing the atribute names, variables and a demonstration of it not working:

This is my code:
import wixData from ‘wix-data’ ;
$w ( ‘#resetButton’ ). hide ();

export function searchButton_click ( event ) {
search ();
}

function search ( ) {

wixData . query ( "enterContest03" ) 
    . contains ( "firstName" ,  $w ( '#searchInput' ). value ) 
    . or ( wixData . query ( "enterContest03" ). contains ( "respuestaCorta2" ,  $w ( '#searchInput' ). value )) 
    

    . find () 
    . then ( results  => { $w ( '#repeater1' ). data  =  results . items ;}); 

    $w ( '#searchButton' ). hide (); 
    $w ( '#resetButton' ). show (); 
    $w ( '#resetButton' ). enable (); 

}

export function resetButton_click ( event ) {
$w ( ‘#tendederoFormsDataset’ ). setFilter ( wixData . filter ());
$w ( ‘#searchInput’ ). value = undefined ;
$w ( ‘#searchButton’ ). show ();
$w ( ‘#searchButton’ ). enable ();
$w ( ‘#resetButton’ ). hide ();
}

Can a kind soul help me out? Im really struggling. Thanks in advance!

So, it seems like you’re mixing two different things. You could do it trough a query, though if you did you’d need to use the onItemReady() function as well to connect the data to the fields you want to put them in.

BUT, I’m guessing you’re using a dataset to fetch the values from the content manager to begin with? If so, you can just filter the dataset rather than do a query, like you do when resetting.

I will be honest and say I haven’t tested this code, but it should work:

import wixData from 'wix-data';
$w('#resetButton').hide();


export function searchButton_click(event) {
    search();
}

function search() {
        $w('#tendederoFormsDataset').setFilter(wixData.filter().contains("firstName", $w('#searchInput').value).or(wixData.filter().contains("respuestaCorta2", $w('#searchInput').value)));

        $w('#searchButton').hide();
        $w('#resetButton').show();
        $w('#resetButton').enable();

}


export function resetButton_click(event) {
    $w('#tendederoFormsDataset').setFilter(wixData.filter());
    $w('#searchInput').value = undefined;
    $w('#searchButton').show();
    $w('#searchButton').enable();
    $w('#resetButton').hide();
}