> 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/dynamic-components/tutorials/components/pivot-table/filter-and-export-a-pivot-table.md).

# Filter and Export a Pivot Table

Add lead source and owner filters to a pipeline pivot table, then an Export button, so a manager narrows the summary and takes it to a meeting in Excel.

Before the quarterly review, a regional manager wants the pipeline summary for web leads only, then a copy of it in Excel for the slides. Header filters narrow the table without a second component, and an **Export** button downloads the filtered table with its totals.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FjqU2otomr9GFwS2rtMqb%2Fpivot-table-filter-and-export-a-pivot-table-result.png?alt=media" alt="Pipeline pivot table filtered on the Web lead source, with Lead Source and Owner filters and an Export button in the header"><figcaption><p>The header filters narrow the totals before the export.</p></figcaption></figure>

## Before you start

* The pipeline Pivot Table from [Summarize Pipeline by Stage and Quarter](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/pivot-table/summarize-pipeline-by-stage-and-quarter.md), or any Pivot Table on **Opportunity**.
* Opportunities with a **Lead Source** filled in.

## Steps

{% stepper %}
{% step %}

### Choose the filter fields

1. Select the Pivot Table. In **Data Mappings**, open **Filters**.
2. Select **Lead Source**, then **Owner ID**. On the page, that filter button reads **Owner**.

Each field becomes a filter in the table header. You can reorder the selected fields in the list.
{% endstep %}

{% step %}

### Decide how the filters look

Open the **Filter** section.

* **Display As Popover**: turn it on to put every filter behind a single button. Leave it off to show one button per filter in the header.
* **Use Record Picklist Values**: turn it on so **Lead Source** only offers values found in the deals, instead of every value defined on the field.
* **Use Cascading Filter Values**: turn it on so that, once a lead source is picked, **Owner** only lists owners who have deals from that source.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2Fqy3lJFkMLFwFCMPeLqoC%2Fpivot-table-filter-and-export-a-pivot-table-filter.png?alt=media" alt="Filters set to Lead Source and Owner ID, and the Filter section with Display As Popover, Use Record Picklist Values and Use Cascading Filter Values" width="320"><figcaption><p>Pick the filter fields, then how they are shown.</p></figcaption></figure>
{% endstep %}

{% step %}

### Add an Export button

1. Open the **Header** section and add an item to **Actions**.
2. **Label**: `Export`. **Name**: `export`. **Icon Name**: `utility:download`.
   {% endstep %}

{% step %}

### Connect the button to Export To

1. Open the **Interactions** tab and add an interaction under **Header Action Click**.
2. **Target Name**: **Export**.
3. **Type**: **Export To**.
   {% endstep %}

{% step %}

### Set the export defaults

These values pre-fill the export dialog. The end user can still change them, unless you hide the dialog.

* **Default File Name**: `Pipeline by Stage and Quarter`.
* **Default Export View**: keep **Formatted Report**, the default. It keeps the layout of the table, with its headers, totals and currency format. **Details Only** gives the same grid with plain numbers.
* **Available File Formats**: keep **Excel** only for a file the manager opens in Excel, or both **CSV** and **Excel** to let them choose. With both, the dialog offers .xlsx (selected first), .xls and .csv.
* **Default Encoding Type**: **Unicode (UTF-8)**, the default, suits most tools. It only applies to a CSV file.
* **Hide Export Dialog**: downloads the file at once with these defaults, as .xlsx when Excel is available. Leave **Default File Name** empty and the file is named after the object, such as `Opportunity`.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2FadvR4p4CW2yv2M6gcGgS%2Fpivot-table-filter-and-export-a-pivot-table-interaction.png?alt=media" alt="Export To settings on the Header Action Click interaction of the Export button" width="320"><figcaption><p>The defaults the export dialog opens with.</p></figcaption></figure>
{% endstep %}

{% step %}

### Save and test

Click **Save** and open the page.

1. Open the **Lead Source** filter and pick **Web**. The totals drop to web deals only. Pick an owner in **Owner** too: both filters apply, and the line under the title reads "Filtered by Lead Source, Owner".
2. Click **Export**. The **Export** dialog opens with your **File Name**, the two **Export View** options and the **Format** list.
3. Click **Export**. The file downloads with the name you set, and holds the filtered table only.

<figure><img src="https://2532358799-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FODPvvv7Cx9Z9RECLn3oV%2Fuploads%2F2zKXJvxpQ8sQwP1eLvgI%2Fpivot-table-filter-and-export-a-pivot-table-dialog.png?alt=media" alt="Export dialog with the file name, the Formatted Report and Details Only views and the file format" width="480"><figcaption><p>The end user confirms or changes the defaults before the download.</p></figcaption></figure>
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
**A filter button can move behind a funnel icon.** With one button per filter, a long selected value, such as an account name, widens the button. When it no longer fits in the header, it moves behind a funnel icon and seems to disappear. The filter is still applied: click the funnel to see it. Turn on **Display As Popover** if your values are long.
{% endhint %}

## Troubleshooting

<details>

<summary>Year or quarter headers look like dates in the file</summary>

With **Formatted Report**, a column grouped by **Year** or **Quarter** can come out of the export as a date (2025-12-31 for the year 2026, 2001-01-01 for quarter 1). Pick **Details Only** in the dialog: its headers are right, and only the currency format is lost.

</details>

<details>

<summary>The Export button does nothing</summary>

No **Header Action Click** interaction targets the button, or its **Type** is not **Export To**. Open the **Interactions** tab and check **Target Name** and **Type**.

</details>

<details>

<summary>Lead Source lists values no deal uses</summary>

Turn on **Use Record Picklist Values** in the **Filter** section. The filter then offers only the values found in the records.

</details>

## Related tutorials

* [Summarize Pipeline by Stage and Quarter](https://docs.avonnicomponents.com/dynamic-components/tutorials/components/pivot-table/summarize-pipeline-by-stage-and-quarter.md): the table these filters narrow.
* [Export To](https://docs.avonnicomponents.com/dynamic-components/component-builder/interactions/export-to.md): the interaction reference.


---

# 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/dynamic-components/tutorials/components/pivot-table/filter-and-export-a-pivot-table.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.
