save a search without deleting the text

Hello to all,
I hope you are well, I am new to this forum :). I have been using wix for some time.

for a few days I have a problem:

I want to save the search data of my users (written by them in a search bar and I retrieve them via a dataset) For this I tried with this piece of code:

It saves the data in the right place, my problem is that it deletes the user input (I think the function is made for form filling) setFieldValue active onItemValuesChanged,

Do you know an idea to save the search without deleting the text, make an invisible save…

many thanks
Alex

$w(“#dataset2”).setFieldValue(“texts”, $w(“#Barre”).value);
$w(“#dataset2”).save();

I solved my problem in this way:

let toInsert = {
“textes” : $w( “#Barre” ).value,
}
wixData.insert( “collection” , toInsert)

(Thanks Ludocodeurwix)