---
title: "Manage audience exports"
slug: "manage-audience-exports"
abstract: "Learn how to connect a Sitecore Connect recipe to an audience export in CDP to automate actions without switching between apps."
---
# Manage audience exports

If your instance of Sitecore CDP has a *Scheduled* or *Live* [segment](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/introduction-to-batch-segmentation/create-and-add-rules-to-a-segment-in-sitecore-cdp.html "Create and add rules to a segment in Sitecore CDP") with at least one segment member, you can start exporting audiences for use outside Sitecore CDP.

## Create an export

To create an audience export:

1. On the navigation menu, click **Audience export** > **Create export**.
2. Determine whether to export [full datasets or deltas](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/data-in-the-export.html#UUID-b89e130c-ae01-8831-e80d-ef1c1ff4a1c8_section-idm4580752251630433871398855589 "Full exports and delta exports"). To export a full audience, click **Full export**. Alternatively, to export deltas, click **Delta export**.
3. Enter a unique and intuitive name for the export and click **Create**. The **Build** screen displays.

After creating an export, you must select an audience and choose an output format for it before you can run it.

## Select an audience for an export

Every audience export must have an audience.

To select an audience for the export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If you are working with a scheduled export, click **Pause** so you can access the **Build** screen.
3. On the **Build** screen, in the **Audience** section, click **Add segment** to select the segment for this export. Alternatively, if a segment is already specified, click **Edit** to select a different segment for this export.
4. Optionally for a full export, to export only a subgroup of the segment, click **Filter**.
    - Click the condition you want to use to filter the audience.
    - Complete the fields for the condition.
    - Click **Save**.

## Choose and configure the output format

Every audience export must have an output format, which defines the file extension and the structure of the exported data. How you configure an output format depends whether you are in [Basic or Advanced mode](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/javascript-in-the-export.html#UUID-e0fcc0c5-b3e4-cbab-1a1c-81f5c3fee3e4_section-idm234968722197438 "Basic and Advanced mode").

::::tabs
:::tab{title="basic-mode"}
### Basic mode

To configure the output format for an audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If you are working with a scheduled export, click **Pause** so you can access the **Build** screen.
3. On the **Build** screen, click **Output format** > **Define output**. Alternatively, if the output format is already specified, click **Edit**.
4. To select Basic mode, at the top of the **Define output** screen, click **Basic**.
5. In **File format**, choose whether to export the audience as a CSV or a JSON output. You can [further customize the CSV output](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/the-output-of-an-export.html#UUID-41e5dc72-4061-fd28-8ee6-58ce253fa513_section-idm4613842249656033871475652859 "File formats").
6. On the **Output structure** tab, click **Add column**, and in the **Header** field, enter a unique text for the header.
7. In the **Attribute value** field of a string field, you can include [various types of data](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/data-in-the-export.html#UUID-b89e130c-ae01-8831-e80d-ef1c1ff4a1c8_section-idm4545492155870433871423726306 "Including data in the output"). For example, hardcoded texts such as *"20EuroOff"* or references to dynamic data in the guest profile such as *${guest.email}*.

    Alternatively, in the **Attribute value** field of a number field, you can include numeric versions of hardcoded or computed integers or floats. For example, *10*, *9.99*, or *${jsResult.age}*. You can also specify the [maximum number of digits](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/data-in-the-export.html#UUID-b89e130c-ae01-8831-e80d-ef1c1ff4a1c8_section-idm4545492155870433871423726306 "Including data in the output").

8. Click **Save**.

:::
:::tab{title="advanced-mode"}
### Advanced mode

To configure the output format for an audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If you are working with a scheduled export, click **Pause** so you can access the **Build** screen.
3. On the **Build** screen, click **Output format** > **Define output**. Alternatively, if the output format is already specified, click **Edit**.
4. To select Advanced mode, at the top of the **Define output** screen, click **Advanced**.

    In Advanced mode, you don't configure the output format in the user interface. Instead, define the object to return directly in the JavaScript. The output will be JSON, and it will match the structure of the complete object that the JavaScript returns.

5. After writing JavaScript, click **Save**.

:::
::::

## Create JavaScript for an audience export with the Code Assistant

> [!note]
> Code Assistant is only available if Sitecore Stream is enabled for your organization.

You can use the [Code Assistant](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/ai-in-cdp/code-assistant.html "Code Assistant") to quickly create [JavaScript](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/javascript-in-the-export.html "JavaScript in the export") to enrich the audience data that you export from CDP. Whether you’re a developer who wants to save time or a marketer without JavaScript experience, the Code Assistant helps you generate code by simply describing what you need in natural language.

To create JavaScript for an audience export with the Code Assistant:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If you are working with a scheduled export, click **Pause** so you can access the **Build** screen.
3. On the **Build** screen, click **Output format** > **Define output**. Alternatively, if the output format is already specified, click **Edit** ![The edit icon](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/edit_pencil.png).
4. Click **JavaScript** > **Code Assistant** to open the left-hand pane.
5. In the left-hand pane, do one of the following:
    - Enter a prompt describing the logic you want to create. Be specific about the criteria, such as guest attributes (gender, city, country), time frames, and the expected return value. See [Prompting the Code Assistant](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/code-assistant.html#UUID-4761b59d-a6fb-217e-76e6-25c914dee8ca_section-idm234959680885744 "Prompting the Code Assistant") for best practices.
    - Select one of the [suggested prompts](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/code-assistant.html#UUID-4761b59d-a6fb-217e-76e6-25c914dee8ca_section-idm234959721673797 "Audience export").

    The Code Assistant generates the code. This might take a few minutes.

    > [!note]
    > The Code Assistant generates code based on your current prompt and any code that's present in the code editor. It does not consider your prompt history or previous codes in the editor.
    >
    > AI responses can vary. Running the same prompt more than once might produce different results.

    After the code is generated, it is labeled with a version number, such as *Code Output 1*.

6. To preview the generated code, click **View**.

    ![The AI-generated code is labeled with a version number in the left-hand pane.](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/cdp-audience-export-js-code-assistant.jpg)

7. In the **Code Output** dialog:
    - To insert the generated code into the editor and replace any existing code, click **Replace code**.
    - To copy the generated code to your clipboard, click **Copy code**.

    > [!important]
    > AI-generated code might not always be accurate. Always review and test the code before using it.

8. Optionally, after inserting the code, you can do the following in the code editor:
    - Make manual changes to the code if needed.
    - Click **Format JS** ![Format JS icon](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/preetify.png) to format your code changes automatically.
    - Click **Undo** ![undo_icon.png](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/undo_icon.png) to revert changes.
9. Click **Save**.

After saving, make sure to [include the computed data in the output](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/javascript-in-the-export.html#UUID-e0fcc0c5-b3e4-cbab-1a1c-81f5c3fee3e4_section-idm4603441978648033871245048397 "Including the computed data in the output") and [test the audience export](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/testing-the-export.html "Testing the export").

## Connect a recipe to an audience export

You can connect an audience export in CDP to an active recipe [created in Sitecore Connect](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/create-a-recipe-in-sitecore-connect.html "Create a recipe in Sitecore Connect"). By connecting a recipe directly within CDP, you can skip manual steps like copying webhook URLs or switching between Sitecore Connect and CDP. This simplifies the workflow, reduces setup time, and helps you activate campaigns faster.

To connect a recipe to an audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If the export is not scheduled, on the **Build** screen, click **Sitecore Connect**.

    If the export is scheduled, pause the export first, then click **Sitecore Connect**.

3. Click **Add recipe**.
4. On the **Sitecore Connect** screen:
    - In the **Environment** drop-down menu, select the Connect tenant where the recipe was created.
    - Choose the recipe you want to connect. Only recipes with *Active* status and a Sitecore CDP action are shown.

Once selected, the recipe appears in the **Sitecore Connect** tile. The audience export is now connected to the Sitecore Connect recipe. Each time the audience export runs, the webhook triggers the connected recipe and performs the defined action.

## Set up email notifications

You can get notified by email when the export finishes running. The [email contains instructions](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/accessing-the-exported-data.html#UUID-824fedac-36f1-752e-26f9-0f89aea2f856_section-idm4550106830696033881634401805 "Email notifications") for downloading the output.

To set up email notifications for the audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If the export is not scheduled, on the **Build** screen, click **Notifications**.

    If the export is scheduled, click the **Notifications** tab.

3. To get notified by email, click **Notify me**. To send additional email notifications to other addresses, click **Add recipients**. In the **Add recipients** field, enter an email address, then press **Enter**.

## Add an external connection to an export

You can send the exported data out of Sitecore CDP to third-party systems, such as social media platforms, digital advertising platforms, email marketing apps, and business intelligence (BI) tools, using an external webhook. You can do this by adding an existing [connection to an external API](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/developer-center/connections/connect-sitecore-cdp-to-an-external-api.html "Connect Sitecore CDP to an external API") to your audience export.

To add an external connection to an audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If the export is not scheduled, on the **Build** screen, click **Notifications** > **Add connection**, then select the connection for this export.

    If the export is scheduled, click the **Notifications** tab > **Add connection**, then select the external connection for this export.

Your audience export is now connected to an external service. The service will receive a webhook notification every time the audience export finishes running.

## Test an export

We recommend that you test an export before running it to make sure that the output of the export will contain the [data you included in the output](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/data-in-the-export.html#UUID-b89e130c-ae01-8831-e80d-ef1c1ff4a1c8_section-idm4545492155870433871423726306 "Including data in the output") following the output structure you configured.

To test an audience export:

1. Navigate to the **Test** window depending on where in the application you currently are:
    - If you are on the **Define Output** screen of an audience export, click **Test**.
    - If you are elsewhere in the application:
        - On the navigation menu, click **Audience export** > **Audience export**, then the export you want to work with.
        - On the audience export page, click **Test**.

            > [!note]
            > If you are working with a scheduled export, click **Pause** so you can access the **Test** button.

2. In the **Test** window, click **Test scenario**.
3. Select a guest for the test:
    - To use a random guest for the test, click the search field, and then in **Quick select**, click **Visitor** or **Customer**.
    - To use a guest from the specific segment used in the audience export, on the **Build** screen, in the **Audience** section, click the segment name to open it. View the segment's [usage and details](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/introduction-to-batch-segmentation/view-segment-usage-and-details.html "View segment usage and details"), and from the **Usage** section, copy a guest reference. Then, paste the copied reference into the search field.
4. Click **Test**. The test runs for the guest.
5. Click **Response**. If the test is successful, the output of the export for this guest displays in **Output**.

    If the test is unsuccessful, an error displays in **Output**. Additional JavaScript logs display in **Logs**. See [common errors](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/troubleshooting-audience-export.html "Troubleshooting audience export") and how to fix them.

## Run a full export instantly

After you select an audience for a full export and choose the output format, you can run the export.

To run a full audience export instantly:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If you are working with a scheduled export, click **Pause** so you can access the **Run now** button.
3. Click **Run now**. The export starts running.

    After the audience export finishes running, you can download the output on the same page in **Activity** > **Finished exports**, by clicking **Download output**.

    If you have set up [email notifications](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-111ac57d-7a30-eb89-d9bc-8327ae2f6610 "Set up email notifications") or [added a connection to the export](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-36eafda2-41cf-1eca-e41e-2cc01143dec9 "Add an external connection to an export"), a notification will be sent.

## Schedule a full export

After you select an audience for a full export and choose the output format, you can run the export.

To run a full audience export on schedule at repeated intervals:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. Click **Schedule**.
3. On the **Schedule audience export** screen, specify the following settings:
    - The **Start** date - choose when the export will run for the first time.
    - The **End** date - choose when the export will run for the last time. When you select a custom end date, it defaults to one year from today. Use the date picker to choose a different date.
    - The **Repeat** interval - choose how often the export will run.
    - The **Run time** - choose at what time of day the export will run.
4. On the **Summary** pane, review the schedule details.
5. Click **Schedule**. The export will run based on the schedule settings.

    After the audience export finishes running for the first time, you can download the output on the same page in **Activity** > **Finished exports**, by clicking **Download output**.

    If you have set up [email notifications](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-111ac57d-7a30-eb89-d9bc-8327ae2f6610 "Set up email notifications") or [added a connection to the export](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-36eafda2-41cf-1eca-e41e-2cc01143dec9 "Add an external connection to an export"), a notification will be sent.

## Schedule a delta export

After you select an audience for a delta export and choose the output format, you can run the export by scheduling it to run once a day.

To schedule a delta audience export on a daily schedule:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. Click **Schedule**.
3. On the **Schedule audience export** screen, specify the following settings:
    - The **Start** date - choose when the export will run for the first time.
    - The **End** date - choose when the export will run for the last time. When you select a custom end date, it defaults to one year from today. Use the date picker to choose a different date.
    - The **Run time** - choose at what time of day the export will run.
4. On the **Summary** pane, review the schedule details.
5. Click **Schedule**. The export will run based on the schedule settings.

    After the audience export finishes running for the first time, you can download the output on the same page in **Activity** > **Finished exports**, by clicking **Download output**.

    If you have set up [email notifications](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-111ac57d-7a30-eb89-d9bc-8327ae2f6610 "Set up email notifications") or [added a connection to the export](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-36eafda2-41cf-1eca-e41e-2cc01143dec9 "Add an external connection to an export"), a notification will be sent.

## Enable and disable downloading the output

Team members with an *Admin* role in Sitecore Cloud Portal can enable and disable the ability to download the output of an audience export directly from Sitecore CDP. This applies to all users in the tenant.

To enable or disable downloading the output directly from Sitecore CDP:

1. On the navigation menu, click ![cdp_gear_icon.png](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/cdp_gear_icon.png) > **Manage features**.
2. Next to **Audience export files download**, turn the switch ![cdp_toggle.png](https://doc.sitecore.com/api/markdown-image/cdp/en/users/sitecore-cdp/images/cdp_toggle.png) on to enable, or turn it off to disable downloading the output.
3. Click **Save**.

## Download the output

> [!note]
> Your Sitecore CDP administrator [controls](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-e8441bf8-d035-950a-9ce0-c65dcb066e06 "Enable and disable downloading the output") whether you can download the output.

After the audience export finishes running, one way you can [access the exported data](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/accessing-the-exported-data.html "Accessing the exported data") is by downloading the output directly from Sitecore CDP.

To download the output of an audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. Click **Activity** > **Finished exports** > **Download output**.

## Pause an export

If you want to edit a scheduled export, for example, reschedule, test, delete, or change the output structure of a scheduled export, or run a scheduled full export instantly, you first have to pause it.

You can run a full export instantly even when it's paused.

To pause an audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. Click **Pause** > **Pause**. You can now access the **Build** screen and edit the export.

## Resume an export

You can resume a paused export so it will run on schedule again.

You can run a full export instantly even when it's paused.

To resume a paused audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. Click **Schedule**, then [schedule the export](https://doc.sitecore.com/cdp/en/users/sitecore-cdp/audience-export/manage-audience-exports.html#UUID-0f85e311-3ae5-223a-a783-8befb6a52fef "Schedule a full export").

## Copy an export

You can create a copy of an export, when, for example, you want a duplicate of an existing export with small differences.

To create a copy of an audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. Click **ellipsis** > **Duplicate**.
3. Enter a unique and intuitive name for the new export and click **Create**. The **Build** screen of the new export displays.

## Delete an export

You can delete an export when you know for certain that no one in your organization needs to use the export.

To delete an audience export:

1. On the navigation menu, click **Audience export**, then the export you want to work with.
2. If you are working with a scheduled export, click **Pause** so you can access the **Delete** button.
3. Click **ellipsis** > **Delete** > **Delete**.