Hello.
I have such a problem, I wrote a script in apps script that inserts the current date and time.
I noticed that once every few days it starts itself, which means that it updates all dates and times in the entire sheet. For the last week it was ok, but on the weekend at night (02:18) Google must have updated something by itself, so I literally had the same date and time everywhere in the spreadsheet (during the weekend at night I did nothing in the spreadsheet)
Is there any method to block this? e.g. after starting the script, it would change from a formula to a value to block later updates/edits?
What it currently looks like is that I have a script that inserts a date and time when a specific word appears in another cell.
=if(N12="COMPLETED", current(), "")This is the whole table so there are lots of such cells (obviously in the formula the reference to the cell with the word "COMPLETED" is changed)
Can anyone help me somehow to make the time and date insert once and never update?
The script looks like this:
function aktual() {
var dzisiaj = new Date();
var dd = dzisiaj.getDate();
var mm = dzisiaj.getMonth()+1;
var yyyy = dzisiaj.getFullYear();
if(dd<10)
{
dd='0'+dd;
}
if(mm<10)
{
mm='0'+mm;
}
var czas = dzisiaj.toLocaleString("pl-PL", {timeZone: "Europe/Warsaw"});
czas = czas.split(", ")[1];
dzisiaj = dd+'/'+mm+'/'+yyyy+' '+czas;
return dzisiaj;
}