# DestinationDocument

Generate one Google Docs file per row from a template (docs-merge).

Type: object

Fields typed as another model are documented on that model's page; fetch it before filling the field.

| Field | Type | Required | Description | Allowed values / default / constraints |
| --- | --- | --- | --- | --- |
| `type` | string | yes | Generates a Google **Docs document** per row from a template (docs-merge). | const: `"document"` |
| `provider` | string | no | Storage provider. Generated documents and PDFs are Google Drive only. | const: `"drive"`; default: `"drive"` |
| `id` | string, nullable | no | Id of an existing folder to write into. Provide this or `folder_name`. |  |
| `folder_name` | string, nullable | no | Name of a new folder to create instead of using an existing one. Provide this or `id`. |  |
| `parent_id` | string, nullable | no | Folder to create `folder_name` inside. Defaults to the drive root. Only valid together with `folder_name`. |  |
| `template_id` | string | yes | Id of the Google Docs file used as the template. Google Drive only. Google Docs are **not returned by default** by the file endpoints — find one with `GET /rest/beta/files/drive?type=gdocs`. |  |
| `file_name` | string | yes | Name pattern for each generated document. Supports {{Column}} smart tags, which are replaced with that row's value — e.g. "Invoice {{Customer}} {{Month}}". See the Smart Tags section. |  |
| `unused_fields` | [UnusedFields](https://dev-api.sheetgo.com/rest/reference/models/UnusedFields.md) | no | What to do when a {{Tag}} in the template matches no source column: `error` fails the run, `ignore` leaves it blank. | default: `"error"` |
| `generator_controller` | boolean | no | Add a column to the source data holding a link to each generated document. | default: `true` |
| `generator_controller_prefix` | string, nullable | no | Prefix for the control column's header. Defaults to the automation name. |  |
| `markdown_formatting` | boolean | no | Render markdown found in cell values as formatted text in the document. | default: `false` |

## Used by

- [GET /rest/beta/automations/](https://dev-api.sheetgo.com/rest/reference/automations.md#get-rest-beta-automations)
- [GET /rest/beta/automations/{id}](https://dev-api.sheetgo.com/rest/reference/automations.md#get-rest-beta-automations-id)
- [GET /rest/beta/workflows/](https://dev-api.sheetgo.com/rest/reference/workflows.md#get-rest-beta-workflows)
- [GET /rest/beta/workflows/{id}](https://dev-api.sheetgo.com/rest/reference/workflows.md#get-rest-beta-workflows-id)
- [PATCH /rest/beta/automations/{id}](https://dev-api.sheetgo.com/rest/reference/automations.md#patch-rest-beta-automations-id)
- [PATCH /rest/beta/workflows/{id}](https://dev-api.sheetgo.com/rest/reference/workflows.md#patch-rest-beta-workflows-id)
- [POST /rest/beta/automations/](https://dev-api.sheetgo.com/rest/reference/automations.md#post-rest-beta-automations)
- [POST /rest/beta/workflows/](https://dev-api.sheetgo.com/rest/reference/workflows.md#post-rest-beta-workflows)
- [PUT /rest/beta/automations/{id}](https://dev-api.sheetgo.com/rest/reference/automations.md#put-rest-beta-automations-id)
- [AutomationCreate](https://dev-api.sheetgo.com/rest/reference/models/AutomationCreate.md)
- [AutomationModel](https://dev-api.sheetgo.com/rest/reference/models/AutomationModel.md)
- [AutomationReplace](https://dev-api.sheetgo.com/rest/reference/models/AutomationReplace.md)
- [WorkflowAutomationModel](https://dev-api.sheetgo.com/rest/reference/models/WorkflowAutomationModel.md)

---

More: start page https://dev-api.sheetgo.com/rest/reference.md, everything in one file https://dev-api.sheetgo.com/rest/llms-full.txt, OpenAPI https://dev-api.sheetgo.com/rest/openapi.json.
