Prompt Library

ChatGPT Prompts for Google Apps Script

20 copy-paste prompts

20 copy-paste ChatGPT prompts for Apps Script: automation across Workspace, custom Sheets functions, Gmail automation, calendar workflows, and the JavaScript-based scripts that extend Workspace.

Sheets Automation

4 prompts

Custom Sheets Function

1/20

Custom Sheets function for [calculation/transformation]. Output: Apps Script code, JSDoc comments, parameters, return type, error handling, deployment as custom function. Test before relying.

Writes custom Sheets functions.

💡

Pro tip: Custom functions extend Sheets formula language. Same as VLOOKUP but yours. JSDoc comments = autocomplete in Sheets. Documentation = usability.

Sheet onEdit Trigger

2/20

Apps Script onEdit trigger for [behavior]. Trigger: when [condition met], do [action]. Output: code with event handling, condition check, action execution, error handling. Watch out for trigger loops.

Builds onEdit triggers.

💡

Pro tip: onEdit fires on EVERY edit. Filter by sheet/range/value to avoid running on irrelevant edits. Unfiltered triggers = performance problem + quota exceeded.

Daily/Scheduled Trigger

3/20

Time-based trigger for [task — daily summary email, weekly cleanup]. Output: trigger setup code, function logic, frequency, time zone considerations, monitoring (script email on error). Set-and-forget automation.

Builds time-based triggers.

💡

Pro tip: Apps Script time triggers = scheduled tasks. "Send weekly summary every Monday 9am" = code + trigger + done. Most users do this manually forever.

Sheet Data Cleanup Script

4/20

Apps Script to clean [paste data structure]. Cleanup: trim whitespace, standardize case, remove duplicates, format dates, fill missing values. Run on demand or schedule. Manual cleanup = repetitive.

Cleans sheet data via script.

💡

Pro tip: Manual data cleanup = 30 min weekly for some teams. Script = 0 min after setup. Compounded time savings; classic Apps Script use case.

Prompts get you started. Tutorials level you up.

A growing library of 300+ hands-on AI tutorials. New tutorials added every week.

Start 7-Day Free Trial

Gmail + Calendar

4 prompts

Gmail Auto-Label Script

5/20

Auto-label Gmail emails matching [criteria]. Beyond Gmail filters (which are limited). Output: Apps Script code, criteria check, labeling, archive option, daily run frequency. Power-user inbox automation.

Auto-labels Gmail via script.

💡

Pro tip: Gmail filters limited (no regex, no complex logic). Apps Script = full programmability. Combine with filters for sophisticated inbox routing.

Email-to-Sheet Logger

6/20

Log emails matching [criteria] to Google Sheet. Output: Apps Script that reads Gmail (filter), extracts data, appends to Sheet, deduplicates, runs on schedule. Email-data → analysis.

Logs Gmail to Sheets.

💡

Pro tip: Patterns in email (e.g., support tickets, lead inquiries) = data. Logging to Sheet = analyzable. Most teams have email patterns + don't analyze.

Calendar Event Bulk Create

7/20

Bulk create Calendar events from Sheet data. Output: read sheet rows, create event per row (title, time, description, attendees), error handling per row, summary email. Mass scheduling.

Bulk creates calendar events.

💡

Pro tip: Manual creation of 50 events = hours. Sheet + script = minutes. Use for: training schedules, recurring 1:1 setups, customer onboarding.

Calendar Conflict Detector

8/20

Apps Script to detect calendar conflicts. Output: scan calendar for overlapping events, highlight conflicts, email summary, integration with team calendars. Conflicts = double-booking risk.

Detects calendar conflicts.

💡

Pro tip: Calendar visible only one at a time = conflicts hide. Script scanning + alerting = preemptive. Especially useful when managing multiple calendars (work + personal).

Cross-App Workflows

4 prompts

Form → Email Notification

9/20

Form submission triggers personalized email. Output: Apps Script onFormSubmit handler, parse response, compose email per response, send, error handling. Replaces basic form notifications.

Sends form-trigger emails.

💡

Pro tip: Default form notification = generic. Custom email per response = personalized acknowledgment + relevant follow-up. Better experience for respondents.

Sheet → Calendar Sync

10/20

Sync Sheet rows to Calendar events. Output: read sheet (project deadlines, milestones), create/update events, handle deletions, two-way sync if needed, schedule. Sheet-as-source-of-truth pattern.

Syncs Sheets to Calendar.

💡

Pro tip: Project deadlines in Sheet + sync to calendar = visibility. Without sync = team forgets. Sheet edit → calendar update = always current.

Doc Template Auto-Generation

11/20

Generate Google Docs from template + data. Output: Apps Script reading data (Sheet/Form), copying template, replacing placeholders, saving to Drive folder, naming convention, link return. Mass doc generation.

Auto-generates docs from templates.

💡

Pro tip: Mass document generation (proposals, reports, certificates) = hours manual. Template + script = minutes. Replace placeholders + save = scaled output.

Slack/Teams Integration via Webhook

12/20

Apps Script post to Slack/Teams via webhook. Output: webhook URL setup, payload format (markdown), trigger logic (event-driven), error handling. Workspace events → chat notifications.

Integrates Workspace with chat.

💡

Pro tip: Form submitted → Slack channel notified = real-time team awareness. Cell changed → Teams alert = trigger-based notifications. Cross-tool integration via webhook.

Like these prompts? There are full tutorials behind them.

Learn the workflows, not just the prompts. 300+ easy-to-follow tutorials inside AI Academy — and growing every week.

Try AI Academy Free

Advanced + Best Practice

4 prompts

Apps Script Project Structure

13/20

Structure Apps Script project for [size]. Output: file organization (separate utilities, triggers, services), naming convention, library use (shared code), version management. Most scripts grow ad-hoc.

Structures Apps Script projects.

💡

Pro tip: One-file scripts work for 50 lines. Beyond = file structure prevents chaos. Separate concerns: triggers, utilities, services. Future you thanks past you.

Error Handling + Logging

14/20

Add robust error handling to Apps Script. Output: try/catch pattern, Logger.log for debug, console.log for Cloud Logging, email on error, retry logic. Production scripts need this.

Adds error handling.

💡

Pro tip: Default scripts fail silently. Try/catch + logging + alert = production-grade. Most user scripts skip; production scripts require.

Quota + Performance

15/20

[Paste slow Apps Script]. Optimize: batch sheet operations (getValues + setValues > one cell at a time), avoid sleep, use built-in services efficiently, monitor execution time. Quota: 6 min/script default.

Optimizes Apps Script performance.

💡

Pro tip: Apps Script quota: 6 min execution. Slow scripts = timeout. Batch operations (read all values at once, transform in memory, write all at once) = 10-100x speedup.

Sharing + Deployment

16/20

Share Apps Script with team. Options: bound to spreadsheet, standalone, library. Output: when each appropriate, deployment as add-on, sharing permissions, version control. Sharing strategy matters.

Plans Apps Script sharing.

💡

Pro tip: Bound script = lives with one Sheet. Standalone = reusable. Library = shared code across scripts. Choose intentionally; conversion is hard later.

Frequently Asked Questions

JavaScript-based platform for automating Google Workspace. Free for Workspace users. Runs in Google's cloud. Like VBA for Office but more powerful + cross-app. Underused but powerful.
Often yes; sometimes hallucinates API methods. Always test in script editor before deploying. Apps Script API well-documented; ChatGPT mostly accurate. Verify trumps trust.
Apps Script: Workspace-native, free, JS-based. Power Automate: Microsoft-native, low-code. Zapier: cross-platform, no-code. For Workspace automation = Apps Script wins on cost + native integration.
Any Workspace app (Sheets, Docs, Forms, Gmail, Calendar, Drive, Slides). Plus external APIs via UrlFetchApp. Cross-app workflows = Apps Script's superpower.
Sheets functions → Sheets triggers (onEdit) → time-based triggers → Gmail automation → multi-app workflows → libraries + add-ons. Build complexity gradually.

Prompts are the starting line. Tutorials are the finish.

A growing library of 300+ hands-on tutorials on ChatGPT, Claude, Midjourney, and 50+ AI tools. New tutorials added every week.

7-day free trial. Cancel anytime.