Google app
Google Docs
DocumentApp scripts open a Google Doc, reach its body with getBody(), and turn row values into a finished document you can share.
Choose a task using Google DocsStart with an outcome
Tasks that use Google Docs
Choose the result first. The service flow shows what this automation connects.
- Google Docs 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 Docs 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.
Snippets
Small pieces for Google Docs
Complete functions you can paste and run one at a time.
Object reference
Objects available in Google Docs
Open an object when you need to get it, try a common action, or inspect exact method signatures.
- Object reference Document
A DocumentApp.Document is the Google Doc file itself. In a bound script, getActiveDocument().getBody() reaches the active tab; in a standalone script, openById(id).getBody() uses the first tab.
- Object reference Document body
The body holds the main text of one tab in a Google Doc, as a list of paragraphs, headings, tables, and other elements. In a bound script, it is the active tab’s body.