# Templates

### Overview

This procedure fills placeholders in a Word document (.docx) template with data from an Excel (.xlsx) file. One output document is generated per row in the spreadsheet. Placeholders in the template are marked by a pair of characters (default is "{}") and must match the column headers in the Excel file.

### Syntax

Below is a line-by-line overview of the automation syntax. Expand each line to learn more.

<details>

<summary><kbd>the template is</kbd></summary>

**What does it do?** Specifies the path to the Word document template (.docx).

**Where does it go?** This phrase should be written on a new line.

**Is it required?** ✅ Yes — This phrase is **required** in the syntax.

**Does it require input data?** ✅ Yes — A **Text** value should be specified.

**Example:** `the template is "path/to/template.docx"`

</details>

<details>

<summary><kbd>the data file is</kbd></summary>

**What does it do?** Specifies the path to the Excel file containing the data (.xlsx).

**Where does it go?** This phrase should be written on a new line.

**Is it required?** ✅ Yes — This phrase is **required** in the syntax.

**Does it require input data?** ✅ Yes — A **Text** value should be specified.

**Example:** `the data file is "path/to/data.xlsx"`

</details>

<details>

<summary><kbd>the template marker is</kbd></summary>

**What does it do?** Defines the two-character marker used to identify placeholders in the template. For example, if the marker is "<>", then a placeholder would look like "". The default is "{}". The marker must be exactly **two** characters.

**Where does it go?** This phrase should be written on a new line.

**Is it required?** 🌟 No — This phrase is **optional** in the syntax.

**Does it require input data?** ✅ Yes — A **Text** value should be specified.

**Example:** `the template marker is "<>"`

</details>

<details>

<summary><kbd>create pdfs from the template where</kbd></summary>

**What does it do?** Starts the PDF generation using the provided template and Excel data.

**Where does it go?** This phrase should be written on a new line.

**Is it required?** ✅ Yes — This phrase is **required** in the syntax.

**Does it require input data?** ⛔ No — This phrase does *not* require input data.

</details>

<details>

<summary><kbd>the excel is the data file</kbd></summary>

**What does it do?** Specifies the Excel file to use for the data source.

**Where does it go?** This phrase should be indented beneath `create pdfs from the template where`.

**Is it required?** ✅ Yes — This phrase is **required** in the syntax.

**Does it require input data?** ⛔ No — This phrase does *not* require input data.

</details>

### Examples

#### 1. Create a PDF From the Template

```
the template is "path/to/template.docx"
the data file is "path/to/data.xlsx"
the template marker is "<>"
create pdfs from the template where
    the excel is the data file
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kognitos.com/legacy/legacy-experience/automation-areas/summary-1/create-pdfs-from-a-template.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
