Update records on database creates a new record

Hey everyone,
Thanks in advance for your time.

Im having a problem with my project, I’ve been looking in other threads but no one seems to work with me.

This is my current code:

import wixData from ‘wix-data’ ;

export function submitButton_click(event, $w) {
$w( ‘#dataset2’ ).onReady()

let currentItem = $w( “#dataset2” ).getCurrentItem();
console.log(currentItem);
let nome = $w( ‘#input3’ ).value;
console.log(nome);
let tipo_carreira = $w( ‘#dropdown1’ ).value;
console.log(tipo_carreira);
let projeto = $w( ‘#dropdown2’ ).value;
console.log(projeto);
let departamento = $w( ‘#dropdown3’ ).value;
console.log(departamento);
let performance = $w( ‘#dropdown4’ ).value;
console.log(performance);
let cargo = $w( ‘#dropdown5’ ).value;
console.log(currentItem);

if (!currentItem.hasOwnProperty( ‘dashno’ ) || currentItem.dashNo !== $w( ‘#input3’ ).value) {
throw Error( ‘filter failed’ );
}

 $w( "#dataset2" ).setFieldValue( "Cargo" , cargo); 
 $w( "#dataset2" ).setFieldValue( "Tipo de Carreira" , tipo_carreira); 
 $w( "#dataset2" ).setFieldValue( "Projeto" , projeto); 
 $w( "#dataset2" ).setFieldValue( "Departamento" , departamento); 
 $w( "#dataset2" ).setFieldValue( "Performance" , $w( '#dropdown4' ).text); 

return $w( “#dataset2” ).save();

 } 

What is happening is that when i click the button to update my records it creates new blank ones.

Thanks again,
Diogo Caetano

Look, there are 2 types of saving data…

save( ) Saves the current item.
setFieldValue( ) Updates the value of a field in the current item.
setFieldValues( ) Updates the values of a set of fields in the current item.

Just a few days ago, or even yesterday i saw a post from " GOS " .
With same topic. He had few good links.
I try to find the post…