Snippets · 92 functions
Apps Script snippets
Each snippet is complete code that compiles against the generated Apps Script declarations. Open a collection, copy the piece you need, and change the placeholder values.
Collections
Pick the app or topic
Each collection lists what it uses so you know which permissions to expect.
- 12 snippets Google Sheets snippets
Twelve short functions for common Sheets tasks: reading rows, writing values, and formatting a tab.
- 12 snippets Gmail snippets
Twelve short functions for common Gmail tasks: searching, reading, sending, and labeling.
- 12 snippets Google Drive snippets
Twelve short functions for common Drive tasks with folders, files, copies, and sharing.
- 11 snippets Google Docs snippets
Eleven short functions that create Google Docs and write or read their content. The functions that open a document by ID work on its first tab.
- 11 snippets Google Calendar snippets
Eleven short functions for common Calendar tasks: reading the default or a shared calendar, creating events, adding a guest, and setting an event color.
- 12 snippets Dates, text, and array snippets
Short functions for dates, currency, text, and arrays. Run one in the Apps Script editor to see its result in the Execution log.
- 12 snippets Triggers and script control snippets
Short functions that install or remove triggers, remember a value between runs, stop two runs from overlapping, and email you when a function fails.
- 10 snippets Web request snippets
Short functions that call a URL with UrlFetchApp. Change the URL and options to match your own API.