> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cassidyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Excel from template

> Generate a Microsoft Excel spreadsheet from a template, filling in placeholders with Workflow data.

Creates an Excel document (.xlsx) from a template by filling in placeholders with dynamic values from your [Workflow](/workflows/overview).

With Cassidy's Excel document templates, you can:

* **Generate standardized invoice reports** that consolidate data from multiple PDF invoices into a consistent format
* **Create financial summaries** with automatically calculated totals and formatted currencies
* **Produce inventory sheets** that expand horizontally and vertically based on your data
* **Build dynamic pricing tables** that adapt to product lists of any size
* **Generate expense reports** with formulas that compute totals, taxes, and approvals

<Steps>
  <Step title="Add the action">
    In the Workflow builder, click **+** between blocks and select **Create Microsoft Excel Document from Template** from the action library.

    <Frame>
      <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-10.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=f74a620c43d59c295ece3be5f3b5b679" alt="Action library with Create Microsoft Excel Document from Template selected" width="960" height="618" data-path="images/reference/create-microsoft-excel-document-from-template-img-10.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-11.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=67a09d0350ea954990f8be3fba8e40ca" alt="Adding the Create Microsoft Excel Document from Template action between blocks" width="1006" height="946" data-path="images/reference/create-microsoft-excel-document-from-template-img-11.png" />
    </Frame>
  </Step>

  <Step title="Upload the Excel template">
    Click to upload your Excel document template (.xlsx file) that contains placeholders for dynamic content. See [Template placeholders](#template-placeholders) below for how to set up your template.

    <Frame>
      <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-13.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=c0c87a624780f26fd09bdc7e3cb17daa" alt="Uploading an Excel template file" width="1010" height="362" data-path="images/reference/create-microsoft-excel-document-from-template-img-13.png" />
    </Frame>
  </Step>

  <Step title="Enter the output document name">
    Provide a name for the generated Excel document. This will be the filename when the document is created. You can use variables from previous steps.

    <Frame>
      <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-14.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=5798fd61fc1ada8c24cb2ed0aaab4fe7" alt="Output document name field with variable support" width="1008" height="214" data-path="images/reference/create-microsoft-excel-document-from-template-img-14.png" />
    </Frame>
  </Step>

  <Step title="Configure template fields">
    Under the **Template Fields** section, map each placeholder in your template to a variable from previous Workflow steps or trigger inputs.

    For example, in an invoice summary template:

    * **\{invoices}** maps to a list variable containing objects with "invoiceNumber", "totalAmount", "date", "dueDate", and "items" properties
    * **\{grandTotal}** maps to a calculated total from your data processing
    * **\{hasVAT}** maps to a boolean variable that controls whether to show the VAT requirements row

    <Frame>
      <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-15.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=857d155e31bfdffa7ba1ed66c86572ff" alt="Template fields configuration with variable mappings" width="1006" height="1158" data-path="images/reference/create-microsoft-excel-document-from-template-img-15.png" />
    </Frame>
  </Step>

  <Step title="Preview and download the document">
    After running the Workflow, preview the generated Excel document and download it by clicking the icons next to the action in the results panel.

    <Frame>
      <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-16.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=43c55acf1c2dd1574f94fab0c6ff45f8" alt="Preview and download icons in the results panel" width="1008" height="222" data-path="images/reference/create-microsoft-excel-document-from-template-img-16.png" />
    </Frame>
  </Step>

  <Step title="Attach the document to other actions (optional)">
    You can use the generated Excel document as an attachment in other actions like [Send Email](/reference/actions/send-email). Reference the Excel document output from this action when configuring email attachments.

    <Frame>
      <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-17.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=71dc9f86469db7059d37a1b6ef3e4378" alt="Attaching the Excel document to a Send Email action" width="1014" height="306" data-path="images/reference/create-microsoft-excel-document-from-template-img-17.png" />
    </Frame>
  </Step>
</Steps>

## Template placeholders

Use placeholders in your Excel template to define where dynamic content should appear. Cassidy detects these placeholders when you upload the template and lets you map them to Workflow variables.

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-0.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=7fa12f283f7d3c4a454997c21dfba1b1" alt="Excel template with placeholder syntax examples" width="2164" height="1264" data-path="images/reference/create-microsoft-excel-document-from-template-img-0.png" />
</Frame>

### Text placeholders

Use text placeholders to insert text, numbers, or formatted content from your Workflow data.

**Syntax:** `{variableName}`

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-1.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=ca0e7dc1e0015284056b95b2faffe618" alt="Text placeholder examples in an Excel template" width="574" height="110" data-path="images/reference/create-microsoft-excel-document-from-template-img-1.png" />
</Frame>

### Conditionals

Use conditionals to display rows or cells only when certain conditions are true, or to show alternative content when conditions are false.

**Syntax:**

* Standard: `{#if:conditionName}` ... `{/if:conditionName}`
* Inverse: `{^if:conditionName}` ... `{/if:conditionName}`

The beginning and end of the conditional must be on the **same row** but in **different cells**.

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-2.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=012f7a65fe60c2b6cfb6cccb4c2cb1b5" alt="Conditional row that only appears when hasVAT is true" width="810" height="110" data-path="images/reference/create-microsoft-excel-document-from-template-img-2.png" />
</Frame>

### Loops

Use loops to create multiple rows or columns from arrays of data.

**Syntax:**

* Vertical loops (for rows): `{#loop:arrayName}` ... `{/loop:arrayName}` — the beginning and end must be on the **same row** but in **different cells**
* Horizontal loops (for columns): `{>loop:arrayName}` — no closing tag needed, place child properties in the same cell

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-3.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=6820ddbe8bafe8cbcb0b51973ad14a42" alt="Vertical loop example with nested line items" width="718" height="104" data-path="images/reference/create-microsoft-excel-document-from-template-img-3.png" />
</Frame>

<Tip>To render correctly, items must be a list where each item has the necessary properties (such as `description` in this case).</Tip>

### Inner loops

When the loop start and end are in the **same cell**, content repeats within that cell instead of creating new rows.

**Template:**

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-4.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=4cba0d6cbf75fdf68d475dbcca6b2248" alt="Inner loop template with start and end in the same cell" width="1534" height="94" data-path="images/reference/create-microsoft-excel-document-from-template-img-4.png" />
</Frame>

**Output:**

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-5.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=cdfe6ca60971548b1436364d87b95318" alt="Inner loop output with multiple values in one cell" width="1546" height="98" data-path="images/reference/create-microsoft-excel-document-from-template-img-5.png" />
</Frame>

### Horizontal loops

Use the `>` prefix to expand data horizontally across columns.

**Template:**

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-6.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=df45deb92a5b609d22f46d26d9cc1301" alt="Horizontal loop template expanding across columns" width="1010" height="138" data-path="images/reference/create-microsoft-excel-document-from-template-img-6.png" />
</Frame>

**Output:**

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-7.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=fffdcc3e13c0b5f663538123462c19c7" alt="Horizontal loop output with data expanded across columns" width="2010" height="136" data-path="images/reference/create-microsoft-excel-document-from-template-img-7.png" />
</Frame>

### Nested loops

You can nest loops to handle multi-level data like invoices with multiple line items.

**Template:**

<Frame>
  <img src="https://mintcdn.com/cassidy/WFAGtWUtSYpipzga/images/reference/create-microsoft-excel-document-from-template-img-8.png?fit=max&auto=format&n=WFAGtWUtSYpipzga&q=85&s=f1793f01c90789a9a3698baba7de0f25" alt="Nested loop template with invoices and line items" width="2004" height="98" data-path="images/reference/create-microsoft-excel-document-from-template-img-8.png" />
</Frame>

**Output:**

<Frame>
  <img src="https://mintcdn.com/cassidy/lmRYjqK_6aYs5Zy7/images/reference/create-microsoft-excel-document-from-template-img-9.png?fit=max&auto=format&n=lmRYjqK_6aYs5Zy7&q=85&s=df4b973a8888544f3d17ea7a55ffc157" alt="Nested loop output with expanded invoices and line items" width="2014" height="176" data-path="images/reference/create-microsoft-excel-document-from-template-img-9.png" />
</Frame>

### Variable scope in loops

When you're inside a loop, you can access both properties of the current item and properties from outside the loop:

1. **Properties of the current item** — use the field names directly
2. **Properties from outside the loop** — these remain accessible

### Data format for loops

If your template has this loop structure:

```
{#loop:items}{description}{/loop:items}
```

Your data must have an array with properties that match the placeholder names exactly:

```json theme={null}
{
  "items": [
    {"description": "Web Design Services"},
    {"description": "Monthly Hosting"}
  ],
  "grandTotal": "$2,500.00",
  "hasVAT": true
}
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="Tags not processed">
    If you see template tags like `{invoiceNumber}` in the final output, double-check that:

    * The variable names in your data match the tag names exactly (case-sensitive)
    * Your data is properly formatted JSON
  </Accordion>
</AccordionGroup>

## Related

* [Create Word from Template](/reference/actions/create-word-from-template)
* [Create PowerPoint from Template](/reference/actions/create-powerpoint-from-template)
* [Export as Excel](/reference/actions/export-as-excel)
* [Create files with Workflows](/guides/create-files)
