@Jeff_Hager wow, mystery solved for me too. I’ve been wondering why that onChange is triggering constantly. I do get errors from google pretty regularly, but it doesn’t seem to be affecting anything that I can see, so I just disregard them.
What kind of “if statement” could I write so that it only triggers for certain sheets? What would that look like exactly? I’d like to implement that if I can. My script is only relevant to a few sheets, so there’s no reason for it to trigger on changes to that App: Metadata sheet.
I already use that method. It’s part of the fuction itself, so comes after the onChange trigger. How would that affect when the onChange command is triggered? I do have lots of if statements within that function that only perform any actual work if a change has been made to a certain sheet. But I thought Jeff was talking about using an if statement to forgo the onChange command completely under certain conditions.
Oh I use the same method as you, which is to check if the event happens on which sheet and whether to continue or not based on that condition. So the script is actually triggered behind the scenes, but whether it leads to an outcome or not depends on the condition.
Check out the script here. Here you can see that the script only continues if the active sheet is “Contacts”. It doesn’t mean that the script won’t run at all, but it will just skip over all of the code if the changed active sheet is not the we want to run code against.
Yes I get occasional errors from Google, but I only have a couple of user’s, so it’s not a big deal. The code that needs to run eventually runs anyway.