ChatGPT Prompts for Google Apps Script
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.
In short: This page contains 16 copy-paste ready prompts, organized into 4 categories with a description and pro tip for each. The first 5 prompts are free instantly, no signup needed. Hand-curated and tested by the AI Academy team.
Sheets Automation
4 promptsCustom Sheets Function
1/16✨ What it does
ChatGPT writes an Apps Script custom Sheets function for [calculation/transformation], with code, JSDoc, parameters, return type, error handling, and how to deploy it. Test it on a copy of the sheet, then use it live only after the result matches a manual check.
Custom Sheets function for [calculation/transformation]. Output: Apps Script code, JSDoc comments, parameters, return type, error handling, deployment as custom function. Test before relying.
Pro tip: Custom functions extend Sheets formula language. Same as VLOOKUP but yours. JSDoc comments = autocomplete in Sheets. Documentation = usability.
Sheet onEdit Trigger
2/16✨ What it does
ChatGPT writes an onEdit trigger for [behavior] that fires when [condition met] and does [action], with event handling, the condition check, the action, and error handling, plus a warning about trigger loops. Paste the three blanks, then test on a dummy cell before you trust it.
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.
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/16✨ What it does
ChatGPT writes a time-based trigger for [task - daily summary email, weekly cleanup], with setup code, function logic, frequency, time zone notes, and error email monitoring. Name the task, then watch the first scheduled run in Executions.
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.
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/16✨ What it does
ChatGPT writes Apps Script to clean [paste data structure] by trimming whitespace, standardizing case, removing duplicates, formatting dates, and filling gaps, on demand or on a schedule. Paste a sample of the columns, then run it on a copy first.
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.
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.
Gmail + Calendar
4 promptsGmail Auto-Label Script
5/16✨ What it does
ChatGPT writes Apps Script that auto-labels Gmail matching [criteria], beyond normal filters, with the check, labeling, an archive option, and a daily run. Set the criteria, then run it once by hand before you schedule it.
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.
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/16✨ What it does
ChatGPT writes Apps Script that logs Gmail matching [criteria] into a Sheet: filter, extract, append, dedupe, and a schedule. Create the destination Sheet, then confirm a test row before you let it run daily.
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.
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/16✨ What it does
ChatGPT writes Apps Script that bulk-creates Calendar events from Sheet rows (title, time, description, attendees) with per-row errors and a summary email. Point it at a test sheet of two rows, then check those events before you run the full list.
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.
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/16✨ What it does
ChatGPT writes Apps Script that scans for overlapping Calendar events, highlights conflicts, emails a summary, and can include team calendars. Run it on your own calendar first, then resolve the overlaps it flags.
Apps Script to detect calendar conflicts. Output: scan calendar for overlapping events, highlight conflicts, email summary, integration with team calendars. Conflicts = double-booking risk.
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 promptsForm → Email Notification
9/16✨ What it does
ChatGPT writes an onFormSubmit handler that parses the response, composes a personalized email, sends it, and handles errors, replacing basic form notifications. Install the trigger, then submit a dummy response to see the email.
Form submission triggers personalized email. Output: Apps Script onFormSubmit handler, parse response, compose email per response, send, error handling. Replaces basic form notifications.
Pro tip: Default form notification = generic. Custom email per response = personalized acknowledgment + relevant follow-up. Better experience for respondents.
Sheet → Calendar Sync
10/16✨ What it does
ChatGPT writes a Sheet-to-Calendar sync that reads deadlines or milestones, creates or updates events, handles deletions, and can do two-way sync on a schedule. Start one-way, then check a changed row updates the event.
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.
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/16✨ What it does
ChatGPT writes Apps Script that copies a Google Doc template, replaces placeholders from Sheet or Form data, saves to a Drive folder with a naming convention, and returns the link. Run it on one row, then open the doc to confirm every placeholder changed.
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.
Pro tip: Mass document generation (proposals, reports, certificates) = hours manual. Template + script = minutes. Replace placeholders + save = scaled output.
Slack/Teams Integration via Webhook
12/16✨ What it does
ChatGPT writes Apps Script that posts to Slack or Teams via webhook, with URL setup, markdown payload, event-driven triggers, and error handling. Paste the webhook into script properties, then fire a test post to a private channel.
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.
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.
Advanced + Best Practice
4 promptsApps Script Project Structure
13/16✨ What it does
ChatGPT structures an Apps Script project for [size] with separate files for utilities, triggers, and services, naming, shared libraries, and version management. Split the growing script into those files, then name functions so the next person can find them.
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.
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/16✨ What it does
ChatGPT adds try/catch blocks, Logger and Cloud Logging, error email, and retry logic to an Apps Script. Wrap the live function, then trigger a fake error to confirm you get the email.
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.
Pro tip: Default scripts fail silently. Try/catch + logging + alert = production-grade. Most user scripts skip; production scripts require.
Quota + Performance
15/16✨ What it does
ChatGPT optimizes [Paste slow Apps Script] with batched getValues/setValues, less sleep, efficient services, and execution-time monitoring against the 6-minute default quota. Paste the slow function, then time the batch version on a copy of the sheet.
[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.
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/16✨ What it does
ChatGPT plans how to share Apps Script with the team: bound to a spreadsheet, standalone, or a library, plus add-on deployment, permissions, and version control. Pick bound if it is one Sheet, then share that Sheet with edit only for maintainers.
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.
Pro tip: Bound script = lives with one Sheet. Standalone = reusable. Library = shared code across scripts. Choose intentionally; conversion is hard later.
Free tool
Prompt Optimizer
Turn a rough idea into a structured, professional AI prompt.
Frequently Asked Questions
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.
Related guides