27 posts tagged with “triggers”

Close Form At Limit

Google Forms can't stop at 50 sign-ups or at Friday 5pm on its own. closeFormAtLimit(form, {maxResponses, closeAt, message}) checks both and…

Notify Once

An hourly trigger checks a condition and emails you when it is true. Without a guard you get the same email every hour until someone fixes…

Snapshot Range To History

Formulas only ever show today's number. The MRR cell said 4,200 last month and 4,650 now, but nobody wrote 4,200 down…

Trigger Inventory For Prompt

Co-Pilot can't see which triggers a project has, so it happily adds a second nightly trigger next to the first, or edits a function without…

Install Menu Safely

Someone renames exportReport to exportMonthlyReport, the menu still points at the old name, and every click says “Script function not found…

Active User Email Or

Session.getActiveUser().getEmail() returns an empty string more often than you'd think: in installable triggers, in “execute as me” web apps…

Is Last Business Day Of Month

Apps Script has no “last business day of the month” trigger. The reliable pattern is a daily time trigger plus a guard at the top of the job…

Under Time Budget

Apps Script kills a execution around the 6-minute wall. If your loop is still mid-UrlFetch when that happens, you lose the chance to write a…

Script Write Guard

Your nightly job rewrites 400 rows by row number. Meanwhile someone edits a cell, your installable onEdit auto-sorts the sheet, and the job…

Create One Shot Trigger At

Some jobs should run once: send the reminder Thursday at 9, close the form at midnight, re-check the invoice in two hours…

Debounce Or Skip

onEdit fires for every cell change — paste 40 rows and your automation thrashes. debounceOrSkip uses CacheService as a quiet window: if a…

Read / Write a Job Checkpoint

Long jobs hit the ~6-minute wall mid-batch. A checkpoint in Script Properties — { key, cursor, updatedAt } — lets the next timed trigger…

Get UI Safe

SpreadsheetApp.getUi() only exists when a user has the spreadsheet open. Time-driven and many installable triggers are headless — calling…

Try Lock Or Skip

Time-driven triggers and overlapping edits collide. withScriptLock waits then throws if it can't acquire — great when failure must be loud…

Delete Triggers by Handler Name

Re-running an install function without cleanup creates duplicate triggers — and suddenly your sync fires five times. This deletes every…

Create a Daily Time-Driven Trigger

Time-driven triggers are how most overnight syncs stay hands-off. This helper creates a once-per-day trigger for a named function around the…