This is the function that runs fine when a signed-in user changes the cell value, but not when someone not signed-in:
It does simple things with the sheet itself and in unprotected ranges.
I have seen online that it should fire even if the file is open in a tab which is in incongnito mode, but it doesn’t even show in the logs that the function has run.
function onEdit(e) {
const sheet = e.range.getSheet();
const sheetsToWatch = ['Content Workbook'];
if (sheetsToWatch.includes(sheet.getName())) {
const headers = sheet.getRange(1, 1, 1, sheet.getMaxColumns()).getValues()[0];
const colToWatch = 'Client Feedback';
const colToWatchIndex = headers.indexOf(colToWatch) + 1;
const row = e.range.getRow();
const colToSet = 'Feedback Processed';
const colToSetIndex = headers.indexOf(colToSet) + 1;
if (e.range.getColumn() === colToWatchIndex && row > 1) {
const row = e.range.getRow();
const timestamp = Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "MM/dd/yyyy HH:mm:ss");
sheet.getRange(row, colToSetIndex).setValue("No");
sheet.getRange(row, colToSetIndex + 1).setValue(timestamp);
}
}
}