I have a field named Echeance that has date of the deadline for each project
I have a field named Statut which referres to the project status (to do, done etc…)
I want if the current date > Echeance and the status is “A faire” then update the cell to “En retard”, which means late.
let action = base.getTable('Action');
let tache = await action.selectRecordsAsync();
let aujourdhui = new Date(); // Date of today
for (let ligne of tache.records){
let statut = ligne.getCellValue("Statut");
let echeance = ligne.getCellValue("Echéance");
let dateEcheance = new Date(echeance);
if (dateEcheance < aujourdhui && statut["name"] == "A faire"){
await action.updateRecordAsync(ligne, {
'Statut': "En retard", // Here is the problem
});
}
}```