What could be the issue with my Google Sheets function not working for one of the tabs?

I have created a Google Sheets file that contains two separate tabs. Most of my functions send notifications properly and trigger emails, but there’s one function, called alertHR(), that fails to send any alerts.

The file consists of tabs named ‘Departed Employees’ and ‘New Hires’. While everything else is functioning well, the alertHR() function responsible for sending notifications for the departed employees doesn’t seem to work anymore.

Previously, I would receive emails stating “Departed [office location] Employee [Employee Name]”, but those emails have stopped coming in. I suspect it might have something to do with how I’m accessing these specific tabs in my code, but I’m unsure where the problem lies.

your alertHR function’s prob failing silently. wrap it in a try-catch block to see what’s breaking. google sheets loves to mess with cell refs when u make changes, and it won’t always tell u when something breaks.

definitely check that! i had a similar issue, and it was just the tab name that was off. also, don’t forget to look at the logs; they can help point out what’s going wrong too!

Check your script permissions and make sure alertHR() can still access your sheets. Google randomly revokes Apps Script permissions, especially if you haven’t used the project in a while. Go to script.google.com, open your project, and run the function manually - it’ll ask for reauth if needed. Also check that your trigger’s still active in the triggers section. They get auto-disabled after failing too many times. I’ve seen functions break when targeting specific tabs if there are hidden characters or formatting changes in the tab names that you can’t see.

Same thing happened to me! My automated reports worked perfectly for months, then just died - no error messages, nothing. Turns out I hit Google Apps Script’s daily email limits. If your script runs a lot or sends to multiple people, you’ll hit those limits faster than you’d expect. The annoying part? It doesn’t always throw an error - just fails silently. Check your quota usage in the Apps Script dashboard under ‘Executions’ and look for any quota exceeded messages. Also double-check that the email addresses in your alertHR() function are still active. I’ve seen the whole thing break when someone leaves and their email gets deactivated.

Classic case of flaky triggers or permission changes. Google Apps Script sucks for ongoing automation like this.

I’ve hit this exact problem at work. Had employee onboarding/offboarding notifications that kept breaking randomly in Google Sheets. Triggers would stop firing or functions would fail silently.

We fixed it by moving everything to Latenode. Set it to watch your Google Sheets - when someone hits the Departed Employees tab, it sends the HR email automatically. No more broken triggers.

You get real error handling and logs too, so you know what’s broken instead of guessing why emails stopped.

Check it out: https://latenode.com