# Google Docs

> Create and edit documents in Google Docs.

App · Documents · 7 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/google-docs

## Triggers

Start a workflow when something happens in Google Docs. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### Google Docs Document Modified

Triggers when a Google Docs document is modified

**Filters**: Narrow which events start a run.

- `document_id` (required)

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `document_id` (text)
- `title` (text)
- `revision_id` (text)

## Actions

### Add bulleted list

Add a bulleted list at the end of a Google Docs document.

**Inputs**

- Document ID (`document_id`, text, required): The ID of the document
- Items (`items`, list, required): The lines of text to add as bullet points

**Outputs**: Bulleted-list insertion result

- `range` (object): Start and end indexes of the inserted list

**Example output**

```json
{
  "range": {
    "end": 120,
    "start": 70
  }
}
```

### Append text

Append text to the end of a Google Docs document.

**Inputs**

- Document ID (`document_id`, text, required): The ID of the document
- Text (`text`, text, required): Text to append to the document

**Outputs**: Append result

- `inserted_at` (number): Index where the text was inserted

**Example output**

```json
{
  "inserted_at": 42
}
```

### Clear document

Clear all content from a Google Docs document.

**Inputs**

- Document ID (`document_id`, text, required): The ID of the document to clear

**Outputs**: No return value

### Create document

Create a new Google Docs document with a given title.

**Inputs**

- Title (`title`, text, required): Title of the new document

**Outputs**: Created Google Docs document

- `document_id` (text): Document ID of the created document

**Example output**

```json
{
  "document_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
}
```

### Get document text

Retrieve the plain text content of a Google Docs document.

**Inputs**

- Document ID (`document_id`, text, required): The ID of the document

**Outputs**: Plain text content of the document

- `text` (text): Plain text content of the document

**Example output**

```json
{
  "text": "This is the document content.\n\nIt has multiple paragraphs."
}
```

### Insert heading

Insert a heading at the end of a Google Docs document.

**Inputs**

- Document ID (`document_id`, text, required): The ID of the document
- Heading text (`heading_text`, text, required): Text for the heading
- Level (`level`, text): Heading size, from largest to smallest: HEADING_1, HEADING_2, HEADING_3, or HEADING_4

**Outputs**: Heading insertion result

- `range` (object): Start and end indexes of the inserted heading

**Example output**

```json
{
  "range": {
    "end": 65,
    "start": 50
  }
}
```

### Replace text

Replace all occurrences of a word or phrase in a Google Docs document.

**Inputs**

- Document ID (`document_id`, text, required): The ID of the document
- Find text (`find_text`, text, required): Text to find in the document
- Replace text (`replace_text`, text, required): Text to replace with

**Outputs**: Replacement result

- `occurrences_changed` (number): Number of occurrences replaced

**Example output**

```json
{
  "occurrences_changed": 3
}
```
