# Map survey response data into Salesforce

With Qwary's Salesforce integration, you can automate survey triggers and effortlessly sync the collected data with Salesforce records. This integration enables in-context analysis, allowing you to generate insightful reports and dynamic dashboards and automate workflows for prompt action based on customer feedback.

By merging survey data with Salesforce, you gain a comprehensive understanding of customer interactions, enabling you to measure and react effectively. This holistic approach enhances the overall health of your business relationships, leading to improved customer satisfaction and strengthened connections.

When the response is received for a case or opportunity, Qwary's salesforce integration&#x20;

* Updates case and/or opportunity object in Salesforce
* Calculates and updates avg. score (NPS/CSAT/CES) for contact for all the responses received by the contact
* Calculates and updates avg. score (NPS/CSAT/CES) for account for all the responses received by all contacts for the account

To get started, you will need to create objects in Salesforce. Below are the object details.

**Create a custom object in Salesforce.**

To create a custom object in Salesforce, Go to Settings --> Object Manager --> Create a custom object.&#x20;

1. Qwary Survey Response - Account
2. Qwary Survey Response - Contact
3. Qwary Survey Response - Case
4. Qwary Survey Response - Opportunity
5. Edit Case Object

**Create a custom object for the Account**

Below is the object definition

| Definition        | Value                                 |
| ----------------- | ------------------------------------- |
| Object Name       | Qwary Survey Response - Account       |
| API Name          | Qwary\_Survey\_Response\_Account\_\_c |
| Label             | Qwary Survey Response - Account       |
| Plural Label      | Qwary Survey Responses - Account      |
| Record Type       | Qwary Survey Name                     |
| Data Type         | Text                                  |
| Deployment Status | Deployed                              |

Fields & Relationship&#x20;

| Field Label           | Field Name                   | Data Type              | Note                                  |
| --------------------- | ---------------------------- | ---------------------- | ------------------------------------- |
| Account               | Account\_\_c                 | Lookup(Account)        |                                       |
| Created By            | CreatedById                  | Lookup(User)           |                                       |
| Last Modified By      | LastModifiedById             | Lookup(User)           |                                       |
| Owner                 | OwnerId                      | Lookup(User,Group)     |                                       |
| Qwary Survey Name     | Name                         | Text(80)               | Survey name for the received response |
| Qwary Survey Response | Qwary\_Survey\_Response\_\_c | Rich Text Area(100000) | Formatted survey response             |

**Create a custom object for the Contact**

Below is the object definition

| Definition        | Value                                 |
| ----------------- | ------------------------------------- |
| Object Name       | Qwary Survey Response - Contact       |
| API Name          | Qwary\_Survey\_Response\_Contact\_\_c |
| Label             | Qwary Survey Response - Contact       |
| Plural Label      | Qwary Survey Responses - Contact      |
| Record Type       | Qwary Survey Name                     |
| Data Type         | Text                                  |
| Deployment Status | Deployed                              |

Fields & Relationship&#x20;

| Field Label           | Field Name                   | Data Type              | Note                                  |
| --------------------- | ---------------------------- | ---------------------- | ------------------------------------- |
| Contact               | Contact\_\_c                 | Lookup(Contact)        |                                       |
| Created By            | CreatedById                  | Lookup(User)           |                                       |
| Last Modified By      | LastModifiedById             | Lookup(User)           |                                       |
| Owner                 | OwnerId                      | Lookup(User,Group)     |                                       |
| Qwary Survey Name     | Name                         | Text(80)               | Survey name for the received response |
| Qwary Survey Response | Qwary\_Survey\_Response\_\_c | Rich Text Area(100000) | Formatted survey response             |

**Create a custom object for the Case**

Below is the object definition

| Definition        | Value                              |
| ----------------- | ---------------------------------- |
| Object Name       | Qwary Survey Response - Case       |
| API Name          | Qwary\_Survey\_Response\_Case\_\_c |
| Label             | Qwary Survey Response - Case       |
| Plural Label      | Qwary Survey Responses - Case      |
| Record Type       | Qwary Survey Name                  |
| Data Type         | Text                               |
| Deployment Status | Deployed                           |

Fields & Relationship&#x20;

| Field Label           | Field Name                   | Data Type              | Note                                  |
| --------------------- | ---------------------------- | ---------------------- | ------------------------------------- |
| Case                  | Case\_\_c                    | Lookup(Case)           |                                       |
| Created By            | CreatedById                  | Lookup(User)           |                                       |
| Last Modified By      | LastModifiedById             | Lookup(User)           |                                       |
| Owner                 | OwnerId                      | Lookup(User,Group)     |                                       |
| Qwary Survey Name     | Name                         | Text(80)               | Survey name for the received response |
| Qwary Survey Response | Qwary\_Survey\_Response\_\_c | Rich Text Area(100000) | Formatted survey response             |

**Create a custom object for the Opportunity**

Below is the object definition

| Definition        | Value                                     |
| ----------------- | ----------------------------------------- |
| Object Name       | Qwary Survey Response - Opportunity       |
| API Name          | Qwary\_Survey\_Response\_Opportunity\_\_c |
| Label             | Qwary Survey Response - Opportunity       |
| Plural Label      | Qwary Survey Responses - Opportunity      |
| Record Type       | Qwary Survey Name                         |
| Data Type         | Text                                      |
| Deployment Status | Deployed                                  |

Fields & Relationship&#x20;

| Field Label           | Field Name                   | Data Type              | Note                                  |
| --------------------- | ---------------------------- | ---------------------- | ------------------------------------- |
| Opportunity           | Opportunity\_\_c             | Lookup(Opportunity)    |                                       |
| Created By            | CreatedById                  | Lookup(User)           |                                       |
| Last Modified By      | LastModifiedById             | Lookup(User)           |                                       |
| Owner                 | OwnerId                      | Lookup(User,Group)     |                                       |
| Qwary Survey Name     | Name                         | Text(80)               | Survey name for the received response |
| Qwary Survey Response | Qwary\_Survey\_Response\_\_c | Rich Text Area(100000) | Formatted survey response             |

**Add new fields to the Case object**

Add the fields below to the case object to update it with response data.

| Field Label   | Field Name          | Data Type      | Note                                                        |
| ------------- | ------------------- | -------------- | ----------------------------------------------------------- |
| Qwary CES     | Qwary\_CES\_\_c     | Number(18, 0)  | Used if case survey campaign has effort score question type |
| Qwary comment | Qwary\_comment\_\_c | Text Area(255) | Used if case survey campaign has comment question type      |
| Qwary CSAT    | Qwary\_CSAT\_\_c    | Number(18, 0)  | Used if case survey campaign has satisfaction question type |
| Qwary emotion | Qwary\_emotion\_\_c | Text(10)       | Used if case survey campaign has emotion question type      |
| Qwary NPS     | Qwary\_NPS\_\_c     | Number(18, 0)  | used if case survey campaign has NPS question type          |
| Qwary rating  | Qwary\_rating\_\_c  | Number(18, 0)  | Used if case survey campaign has rating question type       |
| Qwary thumbs  | Qwary\_thumbs\_\_c  | Text(15)       | Used if case survey campaign has thumbs question type       |

**Add new fields to the Opportunity object.**

Add the below fields to the opportunity object to update the opportunity object with response data

| Field Label   | Field Name          | Data Type      | Note                                                               |
| ------------- | ------------------- | -------------- | ------------------------------------------------------------------ |
| Qwary CES     | Qwary\_CES\_\_c     | Number(18, 0)  | Used if opportunity survey campaign has effort score question type |
| Qwary comment | Qwary\_comment\_\_c | Text Area(255) | Used if opportunity survey campaign has comment question type      |
| Qwary CSAT    | Qwary\_CSAT\_\_c    | Number(18, 0)  | Used if opportunity survey campaign has satisfaction question type |
| Qwary emotion | Qwary\_emotion\_\_c | Text(10)       | Used if opportunity survey campaign has emotion question type      |
| Qwary NPS     | Qwary\_NPS\_\_c     | Number(18, 0)  | used if opportunity survey campaign has NPS question type          |
| Qwary rating  | Qwary\_rating\_\_c  | Number(18, 0)  | Used if opportunity survey campaign has rating question type       |
| Qwary thumbs  | Qwary\_thumbs\_\_c  | Text(15)       | Used if opportunity survey campaign has thumbs question type       |


---

# 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://help.qwary.com/product-guide/workflows/salesforce-workflow/map-survey-response-data-into-salesforce.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.
