Record creation date / modification date of an item

Not that I can think of unfortunately.

it’s really weird. Thanks for your help @ThinhDinh

if it helps somebody, here is the script I use to apply the dates when the first script doesn’t do it’s work. It runs periodically (everyday, but it could be more if I wanted).

function correctionErreursDuScriptOnChange(e) {
var sheet = SpreadsheetApp.getActive().getSheetByName(‘:orange_circle:BLs’)
var rangeData = sheet.getDataRange();
var lastRow = sheet.getLastRow();

var cell = sheet.getRange(“I2”);
for ( i = 0; i < lastRow - 1; i++){
if (cell.isBlank()) {
}
else if (cell.offset(DATETIMELOCATION[0],DATETIMELOCATION[1]).isBlank()) {
var dateTimeCell = cell.offset(DATETIMELOCATION[0],DATETIMELOCATION[1]);
dateTimeCell.setValue(new Date());
}
cell = cell.offset(1,0)
}

var cell = sheet.getRange(“M2”);
for ( i = 0; i < lastRow - 1; i++){
if (cell.isBlank()) {
}
else if (cell.offset(DATETIMELOCATION[0],DATETIMELOCATION[1]).isBlank()) {
var dateTimeCell = cell.offset(DATETIMELOCATION[0],DATETIMELOCATION[1]);
dateTimeCell.setValue(new Date());
}
cell = cell.offset(1,0)
}
}

1 Like