I tried to follow another user’s code, but the first string is not executed:
export function button1_click(event) {
$w('#button1').label = "Updating..."
wixData.get("Anagrafe2", $w('#input4').value)
.then((result) => {
result.piva_cfscl_contraente = $w('#input4').value
result.nominativoContraente = $w('#input2').value
result.comuneIstat = $w('#input21').value
result.codiceProvincia = $w('#input20').value
result.codiceCap = $w('#input7').value
result.indirizzoContraente = $w('#input8').value
wixData.update("Anagrafe2", result)
.then(() => {
$w('#button1').label = "SUCCESSO"
$w('#button1').style.backgroundColor = "#45b6fe"
$w('#button1').style.color = "#FFFFFF"
//return to orginal button
setTimeout(function () {
$w('#button1').label = "MODIFICA CLIENTE"
$w('#button1').style.backgroundColor = "#B6F3E8"
$w('#button1').style.color = "#000000"
}, 1000)
})
})
.catch((error) => {
$w('#button1').label = "ERRORE"
$w('#button1').style.backgroundColor = "#FF0000"
$w('#button1').style.color = "#FFFFFF"
//return to orginal button
setTimeout(function () {
$w('#button1').label = "MODIFICA CLIENTE"
$w('#button1').style.backgroundColor = "#B6F3E8"
$w('#button1').style.color = "#000000"
}, 1000)
});
}