> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/export-to.md).

# Export To

The Export To interaction exports a data table's or pivot table's records to a downloadable file.

## Overview

{% hint style="info" %}
This interaction is available on the [Avonni Data Table](https://docs.avonnicomponents.com/flow/flow-components/data-table.md) and the [Avonni Pivot Table](https://docs.avonnicomponents.com/flow/flow-components/pivot-table.md).
{% endhint %}

The Avonni Data Table and Pivot Table let users export their data to an Excel or CSV file. This is helpful for analyzing, sharing, or archiving data outside of Salesforce.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-8387437089313c7f40c9f1fead76f2a76f2cf9f9%2F2023-04-27_15-36-18.png?alt=media" alt=""><figcaption></figcaption></figure>

## Configuration

### 1️⃣ Add an Action Button

Decide whether you want the export button to be a [**row action**](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/creating-row-actions.md) (on each row) or a [**header action**](https://docs.avonnicomponents.com/flow/flow-components/data-table.md#header) (at the top of the table).

{% @arcade/embed url="<https://app.arcade.software/share/koTSHldm1QynABdHFPnM>" flowId="koTSHldm1QynABdHFPnM" %}

### 2️⃣ Create the interaction:

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fgit-blob-e3be5fba7e756cf29842639dd80bfacc726f111e%2F2023-04-26_20-53-22.png?alt=media" alt=""><figcaption></figcaption></figure>

* In the "Interactions" tab, click "Add" and choose "Row Action Interaction" or "Header Action Interaction," depending on what you chose in step 1.
* Select the name of the action you created.
* Choose "**Export To**" as the interaction type.
* Fill in the settings below.

### 3️⃣ Settings

* **Default File Name** — the name the exported file is created with. Users can change it in the export dialog.
* **Hide Export Dialog** — skips the dialog and downloads the file straight away, so users don't pick the format, encoding, or file name.
* **Available File Formats** — the formats offered in the dialog: **CSV**, **Excel**, or both (both by default).
* **Default Encoding Type** — the character encoding the file is written with, **Unicode (UTF-8)** by default.
* **Export All Data** — Data Table only. Exports all the data, up to a limit of 50,000 records.
* **Default Export View**: Pivot Table only. **Formatted Report** (default) exports the grid as it appears, with its formatting; **Details Only** exports the same grid with raw, unformatted values.

**That's it!** Now your users can easily export data from the Data Table.

## Saved JSON example

Interactions are saved as a JSON array in the interaction attribute of the component. This is an "Export To" interaction using the exact key names:

```json
[
  {
    "targetName": "download",
    "type": "DatatableExportTo",
    "exportToFileFormat": ["csv", "excel"],
    "exportToEncodingType": "utf-8"
  }
]
```

* `targetName` is the Target Name of the row or header action that triggers the interaction.
* `type` is the interaction name, `DatatableExportTo`.
* `exportToFileFormat` lists the formats offered: `csv`, `excel`.
* `exportToEncodingType` is the default encoding: `utf-8`, `ISO-8859-1`, `unicode`, `windows-31J`, `shift_jis`, `gb18030`, `gb2312`, `big5`, `euc-kr`, `utf-16` or `big5-hkscs`.
* Optional keys: `exportToFileName` (default file name), `exportToAllData` (`true` exports all data, up to 50,000 records) and `hideExportDialog` (`true` downloads the file without the dialog).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/export-to.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
