# Enable Data Export

## Overview <a href="#introduction" id="introduction"></a>

This tutorial shows you how to create an "Export to" interaction for your [**Avonni Data Table**](/dynamic-components/components/data-table.md). This interaction enables users to export entire datasets or selected rows in Excel or CSV format.&#x20;

<figure><img src="/files/jyTZ41j4Qom9gZtPXNrH" alt=""><figcaption></figcaption></figure>

***

### Steps to Create an "Export to" Interaction <a href="#steps-to-create-an-export-to-interaction" id="steps-to-create-an-export-to-interaction"></a>

{% stepper %}
{% step %}

### Create a Header action on the Data Table <a href="#id-1.-create-an-action-on-the-data-table" id="id-1.-create-an-action-on-the-data-table"></a>

Place an action button directly in the Data Table's header to handle data exports. We'll create an "Export" button that lets users download the table data as an Excel or CSV file. This action is configured to be context-aware: it exports only the specific rows the user has selected. However, if no rows are selected, it exports all the data currently displayed in the table.

<figure><img src="/files/2tGr4Gmxc37Zk1cciwI5" alt="" width="375"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create the interaction from the interaction panel <a href="#id-2.-create-the-interaction-from-the-interaction-panel" id="id-2.-create-the-interaction-from-the-interaction-panel"></a>

To set up the data export triggered by the action element you created, follow these steps in the Interaction Panel:

1. **Go to the Interaction Panel**: Look for the interaction options.
2. **Choose Target**: Select the action you created in [**Step 1**](#steps-to-create-an-export-to-interaction) from the dropdown list.
3. **Set Type to 'Export To'** to enable data export.
4. **Default File Name**: Enter a pre-filled name for the exported file, which users can change later. Select "**Mapped**" from the icon menu for dynamic file naming and choose one of your flow resources. This allows the file name to be generated dynamically based on your selected resource.
5. **Optional - Simplify Export**: To speed things up, you can hide the export dialog, limiting user choices on file format and encoding.
6. **File Format**: Pick the formats, like Excel or CSV, that are available for export.
7. **Default Encoding**: Choose a standard encoding to ensure the file works well with most software.

<figure><img src="/files/ztJXvTKH0MSQLsGB96XJ" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Wrap-Up <a href="#wrap-up" id="wrap-up"></a>

Following this straightforward guide, you've added an "Export to" feature to your Avonni Data Table. This enhances usability by enabling users to export data for analysis, sharing, or archiving outside your application.


---

# 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.avonnicomponents.com/dynamic-components/tutorials/components/data-table/enable-data-export.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.
