Google app
Google Sheets
SpreadsheetApp lets a Google Sheets script read a Sheet or Range, add a custom menu or formula, and run repeatable actions across rows.
Choose a task using Google SheetsStart with an outcome
Tasks that use Google Sheets
Choose the result first. The service flow shows what this automation connects.
- Google Sheets Send an email for each row in a Google Sheet
Use one row per person, then let the script send only the rows that have not already been marked as sent.
- Google Sheets Send an email when a status changes
When someone changes a status dropdown in Google Sheets, email the address on that row, including on newly copied tabs.
- Google Sheets Create a Google Doc from each Sheet row
Keep a person and a project note in a Sheet, then create one short Doc per unfinished row.
- Google Sheets Add a custom menu to a Google Sheet
Use an onOpen() simple trigger and SpreadsheetApp.getUi().createMenu() to add a custom menu bar item that shows which cell is currently selected.
- Google Sheets Add a timestamp when a row changes
Change a status cell and the script stamps the same row with the current date and time. There is nothing to install beyond saving the script.
- Google Sheets Copy a row when a checkbox is checked
Check an Active checkbox on a Students tab and an onEdit trigger appends a tracking row to your Tracking tab once, then marks the source row Tracked so re-checking does not add a duplicate.
- Google Sheets Write a custom function in Google Sheets
A Google Sheets custom function is a top-level Apps Script function you call from a cell like a built-in formula, with an optional @customfunction tag for formula autocomplete. This guide converts Celsius to Fahrenheit for one cell or a range.
- Google Sheets Copy unique rows to a clean tab
The script reads your list, keeps the first row for each email address, and rewrites a tab named Clean. The source tab is never changed.
- Google Sheets Move finished rows to an Archive tab
Rows with the status Done are copied to the bottom of an Archive tab and then removed from Tasks. This one deletes rows, so test it on a copy of the file first.
- Google Sheets Fill a Google Doc template from a Sheet row
Each row that has no link yet gets its own copy of your template Doc, with the placeholders swapped for the values in that row. The link to the copy goes back in the last column.
- Google Sheets Log new emails to a Google Sheet
Search your recent mail and add one row per message to a tab named Email log. A hidden ID column keeps a second run from adding the same message twice.
- Google Sheets Import data from a web API into Sheets
The script reads Open-Meteo once and replaces only Forecast!A1:C12 after checking the response and the destination. It preserves the source and licence links beside the forecast.
- Google Sheets Create Calendar events from Sheet rows
Keep one planned event per row in a tab named Events. The script creates the events that have no ID yet and writes the new ID back into the row.
- Google Sheets Email yourself a weekly sheet summary
Run the setup function once. Each Friday the script reads the Orders tab, counts the nonblank rows, totals column C, counts the rows that are not Done, and emails the account that installed it.
- Google Sheets Back up a spreadsheet to Drive every week
Run the setup function once. Every Monday morning the script copies the spreadsheet into a Drive folder and puts the date in the copy name. The original is never touched.
Snippets
Small pieces for Google Sheets
Complete functions you can paste and run one at a time.
Object reference
Objects available in Google Sheets
Open an object when you need to get it, try a common action, or inspect exact method signatures.
- Object reference Spreadsheet
A Spreadsheet is the whole Google Sheets file. Use SpreadsheetApp.getActiveSpreadsheet() or openById() to get it, then call getSheetByName() or getActiveSheet().
- Object reference Sheet
A Sheet is one tab inside a Google spreadsheet. Reach it with getSheetByName() or getActiveSheet(), then inspect getLastRow() or read cells with getRange().
- Object reference Range
A Range represents one cell such as A2 or a rectangular block of rows and columns in a Sheet. Use getValue() for one cell and getValues() or setValues() for a 2D array of rows.