Google Apps Script automation for Sheets
Get a working Google Apps Script to automate a Sheets task, with setup steps, triggers, error handling and a safe way to test it.
- Published
- Works with
- ChatGPT, Claude and Gemini
- Level
- Intermediate
Many repetitive spreadsheet chores — sending emails from rows, copying data between tabs, cleaning imports every morning — can be automated with Google Apps Script, but most people don't know where to start. This prompt describes your sheet and the task precisely so the AI writes a script that fits your columns, explains how to install it and adds triggers and error handling.
The prompt
Act as an experienced Google Apps Script developer. Write a script to automate this task.
What I want automated:
Spreadsheet structure:
Example rows:
When it should run:
Other services involved:
Things to avoid:
Provide:
1. The complete script with clear comments, using column names from my headers (not hard-coded letters where avoidable).
2. A "processed" flag or timestamp column so rows are never handled twice.
3. Error handling and logging.
4. Step-by-step install instructions: open the editor, paste, save, authorise, set the trigger.
5. A safe test plan using a copy of the sheet.
6. Any quotas or limits that might affect this, phrased as "check current limits in Google's documentation".
How to use it
- Use fake example rows; don't paste customer emails or personal data.
- Test on a copy of the spreadsheet before pointing the script at the real one.
- Paste any error message back into the chat to get a fix.
Tips
- Ask for a custom menu item so non-technical teammates can run the script with a click.
- Batch reads and writes (getValues/setValues) to keep scripts fast on big sheets.
Frequently asked questions
What does this prompt do?
Get a working Google Apps Script to automate a Sheets task, with setup steps, triggers, error handling and a safe way to test it.
Which AI tools does it work with?
It is written for ChatGPT, Claude and Gemini. It also works in other AI tools that accept text prompts, with small changes.
What do I need to fill in?
6 blanks: e.g. email each client their row when status = "ready" / copy new form responses to a clean tab / create a weekly summary; tab names, column headers and what each holds, header row number; 2–3 rows with fake data; on edit / on form submit / daily at 7am / manually from a menu; e.g. gmail, google calendar, google drive; e.g. sending duplicate emails, overwriting data. Click each blue blank on the page, type your details and press Copy prompt.
Is this prompt free to use?
Yes. You can copy and use it for personal and commercial work.