> ## Documentation Index
> Fetch the complete documentation index at: https://help.cloudtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Export Survey Answers

> Using Workflow Automations, we can export survey responses from a campaign to a preferred CRM system

> [!NOTE]
>
> **Automation Goal:** Forward survey responses from an ongoing campaign to a separate CRM or management system account.

**User Level**: Admin

***

## Exporting Survey Answers

Contact answers to survey questions will be stored with the campaign alongside other aggregated data, like the campaign statistics. Campaign contact lists [imported from Salesforce](https://help.cloudtalk.io/en/articles/9170735-salesforce-contact-lists-in-campaigns.md) can be configured to export survey answers automatically. When you need to export this data to another endpoint, it can be done with our workflow automations. This data can be logged for internal tracking purposes, or sent to a third party like a CRM.

### Workflow Automation Setup

1. From Cloudtalk dashboard, navigate to **Settings > Workflow Automations**.

2. Select **`+Add Workflow`** and name your workflow.

3. Define a **[trigger](https://help.cloudtalk.io/en/articles/5648924-triggers.md)**. In this example, we should configure the automation before the start of our campaign, so that it can run in real time as the campaign is taking place. As the campaign is carried out through calls to customers, we will select **Call** as **Object**. For **Action**, we select **ended**.

   ![](https://mintcdn.com/cloudtalk/Ayep-6hjQnBpSGZo/images/help-center/articles/7896628/02b698efbdeb-image.png?fit=max\&auto=format\&n=Ayep-6hjQnBpSGZo\&q=85\&s=a182f6c9844ef1c4837b0670f4097d61)

4. This automation will require some conditions. The first condition will ensure that *dropped* calls will not be counted in the trigger.

   1. Click into the **Property** field and refer to the **Useful data for your Workflow** box. From the options, choose **talking\_time**. The **Property** box will autofill with the dynamic value `event.properties.talking_time`.

      ![](https://mintcdn.com/cloudtalk/Ayep-6hjQnBpSGZo/images/help-center/articles/7896628/0a3e2a264758-wfa-condition-2.png?fit=max\&auto=format\&n=Ayep-6hjQnBpSGZo\&q=85\&s=9bb6d63cf281b852fb329e6b7420811e)

   2. Select the **Operand** *is greater than*. For **Value**, enter `10`.

   3. Our logical statement tells the system to only trigger when an ended call had a talk time greater than ten seconds (allowing some buffer time for connection lag).

5. Another condition is needed to make sure that this automation only applies to the specific campaign we want.

   1. Click the **Property** field, then select the **arrow icon** next to `dialer_data` in the **Useful data for your Workflow** box.

      ![](https://mintcdn.com/cloudtalk/Ayep-6hjQnBpSGZo/images/help-center/articles/7896628/a07b144d2719-drop.png?fit=max\&auto=format\&n=Ayep-6hjQnBpSGZo\&q=85\&s=86aabcc0e5ef0575a2bdd1da7c5e4772)

      This will expand related keyword options. Next to `campaign`**,** there is another **arrow icon** to expand more options.

      ![](https://mintcdn.com/cloudtalk/9VIELngG1B1_Y1Cb/images/help-center/articles/7896628/b37486e970ad-image.png?fit=max\&auto=format\&n=9VIELngG1B1_Y1Cb\&q=85\&s=d13629d019bbeb3a134e1208a0b01e73)

   2. From these, choose `name`. The **Property** box will autofill with `event.properties.dialer_data.campaign.name` .

   3. For **Operand** select *is equal to*.

   4. In the **Value** box, enter the name of the campaign this automation should apply to. Include capital letters and any spaces.

      ![](https://mintcdn.com/cloudtalk/9VIELngG1B1_Y1Cb/images/help-center/articles/7896628/b01d19e1f7c4-image.png?fit=max\&auto=format\&n=9VIELngG1B1_Y1Cb\&q=85\&s=46526531e729deb499b72c3a6efbef37)

6. The next step is to choose an action which will happen at the end of any call from "My Campaign October" with a talk time greater than ten seconds. As an **Action type**, we'll choose **API request**.

   1. We need an **Endpoint**. It will be an API or token URL.

   2. As a **Method**, we choose **POST**, as we will be sending new data to the desired endpoint.

      ![](https://mintcdn.com/cloudtalk/Ayep-6hjQnBpSGZo/images/help-center/articles/7896628/1832aa084749-image.png?fit=max\&auto=format\&n=Ayep-6hjQnBpSGZo\&q=85\&s=92b418f3ac351b6aed0d528b18bf0f27)

7. *Headers* represent metadata of the request and *[Values](https://help.cloudtalk.io/en/articles/5649782-actions.md)* represent the request body. Within the *Headers* and *Values* subsections, there can be multiple `[Key, Value]` pairs.

8. To include survey answers in your API request, configure the API request body property to include the survey answers.

   1. In the *Values* section, enter the **Key** `survey_answers`.

   2. From the **Useful data for your Workflow** box, choose `survey_answers` (located under `dialer...+`**)**. The **Value** field should autofill with

      `#{{ event.properties.dialer_data.survey_answers[0] }}`.

      ![](https://mintcdn.com/cloudtalk/Ayep-6hjQnBpSGZo/images/help-center/articles/7896628/47f087dec651-wfa-survey.png?fit=max\&auto=format\&n=Ayep-6hjQnBpSGZo\&q=85\&s=8980474109c81982e5d2b87935a0ffc8)

9. From this point, we will need to make a small edit to the dynamic value which has populated.

   1. The `[0]` at the end of `event.properties.dialer_data.survey_answers[0]` represents an index of the first or "0" item in our survey. To return *all* answers in the field, we would use the following:

      `#{{ event.properties.dialer_data.survey_answers | dump }}`.

      1. This represents the parent object containing all answers, which will be transformed into readable format (refer to [Jinja templating language docs](https://mozilla.github.io/nunjucks/templating.html))*.*

      ![](https://mintcdn.com/cloudtalk/Ayep-6hjQnBpSGZo/images/help-center/articles/7896628/3091afc02226-image.png?fit=max\&auto=format\&n=Ayep-6hjQnBpSGZo\&q=85\&s=e198255fa652e90e5f5c1b1cade5fb12)

10. Include any required API request components in both the **Values** and **Headers** sections of the API Request configuration, following the documentation for the external API you are using to export your survey data.

11. **`Confirm and continue`**.

12. **`Save`** your workflow and activate it by toggling the switch at the top of the workflow setup page.

    ![](https://mintcdn.com/cloudtalk/Ayep-6hjQnBpSGZo/images/help-center/articles/7896628/6b585e4120c8-wfa-activate.png?fit=max\&auto=format\&n=Ayep-6hjQnBpSGZo\&q=85\&s=b0869003070abb32faabba298db0dbe6)

***

*Need help or have a question?* Just reach out through our [Support portal](https://support.cloudtalk.io/hc/en-us/requests/new?ticket_form_id=26305535257884) — we’re here for you.


## Related topics

- [Surveys](https://help.cloudtalk.io/en/articles/17029647-surveys.md)
- [Surveys (Legacy Dialer)](https://help.cloudtalk.io/en/articles/15103961-surveys-legacy-dialer.md)
- [Workflow Automations guide](https://help.cloudtalk.io/en/articles/10568412-workflow-automations-guide.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.