Function onEdit: how can it be applicable to apps?

Hello everybody. How are you?

In my second post, I would like to describe you a problem I have been facing since I have created a trigger called “unCheck”.

The basic idea involved in this script is to uncheck a checkbox if its value is true for a specific duration, let’s say 5 minutes. There are two functions inside: onEdit to record when it was edited and the variables related to the edited cell and the uncheck function which receives the variables and compare the time the checkbox was checked (TRUE value) with a specified time. If it’s equal or higher to the specified, the checkbox is unchecked.

The problem I’ve been facing is that the script is only being able to recognize editions I’ve done while working directly on the Google Spreadsheets. I’ve tried many times to edit using the app and the checkbox doesn’t get unchecked afterwards.

Does anyone know a way around this issue? Please let me know!

Kind Regards,

Danillo S. Soares

onEdit triggers will not detect changes coming from Glide.
If you want to detect and act on Glide changes, you need to use an onChange trigger.


Hey Darren, thanks for you reply!
I’ve tried googling the differences between onEdit and onChange and I will probably need to change dramatically my code because is not just to change the function name in order to make it work out, right? Do you have any insights to share with me please?

I’m wondering whether a time based trigger would work for your use case?
As I understand it, you have a checkbox column and a timestamp column. It should be simple enough to write a function that can be called once a minute that checks the state of each checkbox and when it was set - and then unset it if the change was greater than X mins ago.

The other thing I would encourage you to do is investigate whether you can move all of this logic to Glide and avoid the need for a script altogether.

1 Like