# Advanced Export

{% hint style="success" %}
This is the official documentation of the `@forestadmin/agent` Node.js agent.
{% endhint %}

The advanced export plugin allows to implement custom data exports in various formats.

### Installation

```sh
npm install @forestadmin/plugin-export-advanced
```

### Configuration

The plugin can be used directly on the Agent, or a specific Collection. Using it on the Agent will enable the export for all Collections.

All settings are optional. Not providing them will open a form in the UI to configure the export.

```js
import { addExportAdvanced } from '@forestadmin/plugin-export-advanced';

agent.customizeCollection('accounts', collection => {
  collection.use(addExportAdvanced, {
    /**
     * The name of the export button
     * default: Export <collection name> (advanced)
     */
    actionName: 'Export mailing list',

    /**
     * The name of the export file, should not include the extension
     */
    filename: 'mailing-list',

    /**
     * The format of the export file
     * Supported formats are: '.csv', '.xlsx', '.json'
     */
    format: '.xlsx',

    /**
     * The fields to export.
     * Relations can be exported using the following notation.
     */
    fields: [
      'firstname',
      'lastname',
      'email',
      'address:streetName',
      'address:city',
      'address:country',
    ],
  });
});
```


---

# 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.forestadmin.com/developer-guide-agents-nodejs/agent-customization/plugins/provided-plugins/export-advanced.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.
