Revised function:
When a cell in column 8 is changed to ‘Em contacto’, a timestamp appears in column 14. Test this updated code on new Google Sheets:
function processEdit(e) {
const sheet = e.source.getActiveSheet();
if (e.range.getColumn() === 8 && e.value === 'Em contacto') {
sheet.getRange(e.range.getRow(), 14).setValue(new Date());
}
}
In my experience the onEdit trigger is functioning as intended on the latest Google Sheets when it comes to manual cell edits. I encountered some rare exceptions when dealing with automatic changes or protected ranges, so it is important to verify that the edit is initiated by the user. The function worked well during my tests when updating the cell manually. It might not work as expected for changes through scripts or external tools, though that appears to be more about the source of the change rather than a flaw in onEdit itself.
i’ve been using the onedit trigger and it works fine for manual edits. noticed it misfirs when the change comes via a script, so make sure the edit is really user-driven. overall, latest sheets perform as expected in that regard.
In my experience, the onEdit trigger works fine when it is used for simple, manual changes in the latest version of Google Sheets. I have observed that it reacts accurately in most cases where the event is clearly a user action. However, I did find that if there are simultaneous changes or non-traditional edits via import or script, there might be delays or missed triggers. It is advisable to keep the function logic straightforward and to monitor the behavior in varied real-world scenarios to ensure consistent operation.
In my experience, the onEdit trigger generally functions well in the latest version of Google Sheets when the change comes directly from user interaction. While I have seen it work reliably during normal cell edits, I did notice that when changes happen through copy-paste operations or when a script updates cells, the trigger might not always fire as expected. This behavior seems to be more about how the change is initiated rather than an inherent flaw in the trigger itself. I would recommend thorough testing, especially if your workflow depends heavily on these triggers.
i tried it myself and noticed that onedit works fine for obvious manual changes. however, for more complex or auto filled cells, the trigger sometimes doesnt fire correctly. better to keep things as simple as possble.