RESOLVED - Problem Save only 1 data from many collection

Hi everyone, I’m still here for an explanation.

I have a collection with these fields:

“dataEvento” type Date
“tipoEvento” type Drop Down
“nomeEventoOErimonia” type text
“code” type text
“utenteRedirect” type Drop Down
“redirect” type Url
“attivo” type boolean

Through a button I want to update only one field, and the others leave them unchanged. This is my code

let index = null;
let idRows = null;
let AttivoRows = null;
let NameRows = null;

export function TabEventi_rowSelect(event) {
index = event.rowIndex;
idRows = event.target.rows[index]._id;
AttivoRows = event.rowData.attivo;
}

export function serviceActivate_click() {
let toSave = {
“_id”: idRows,
“attivo”: AttivoRows
};

wixData.save("RedirectCerimonie", toSave) 
	.catch( (err) => { 
		let errorMsg = err; 
		console.log(errorMsg); 
	}); 

}

What happens after the command is started. The field that I want to update is updated, the problem is that the other fields are deleted and appears in consolelog this:

Wix code SDK Warning: This is a text that can not be set to null or undefined.

Who can help me?

Thank you

Someone Help me?

Nobody who can help me?
Thank you

Hi,
If you want to update an item that already exists in the database you need to use the Update function instead of “save”.

Good luck:)

Hello, thanks for your reply,
but the result does not change, I get the same result
Attach image of what succe:

Hi,
When you use the update function you need to supply values to all of the fields.
You can use query to get the current values, change the fields you want to update and then use the update function.

Good luck :slight_smile:

Thank you,
very useful, I did not know how to get the current value, so I also learned a new education

Thank you!!!