Salesforce

Trigger surveys automatically and use survey data in Salesforce.

agent connect and salesforce logos

The integration of Medallia Agent Connect and Salesforce enables you to send feedback requests to customers automatically after your team closes tickets in Salesforce, then receive completed survey data back from Agent Connect into Salesforce. With automatic surveys, you can ensure that all critical interactions are reviewed and scored. With data return, you can enhance Salesforce reporting or automatically trigger service recovery workflows.

This guide will help you to install, configure, and use Version 2 of the Salesforce managed package from Agent Connect.

Important: Before you begin the integration, ensure that you have entered a test email address in Agent Connect and have collected your test and production API credentials. For more information, see Integrations.

For more information outside the scope of this guide, see the following articles:

Note: Before updating to a new version, if you already have field mappings for base objects from an older version of our managed package, we highly suggest taking a screenshot of those field mappings for reference. Guidance on backing up your data from Salesforce can be found in the official Salesforce documentation.

Integration overview

The Agent Connect integration with Salesforce enhances your QA interactions and Salesforce case records. There are three main components to the integration:

  • Automated survey requests — As a first step, the integration automatically triggers Agent Connect survey requests when a customer interaction is completed, based on defined triggers in Salesforce.

  • Automated data return — After a customer completes a survey, Agent Connect sends back the results of the survey to be attached to the Salesforce case.

  • Service recovery opportunities — With the completed survey data attached to a Request record, you can use a Salesforce Flow to automatically identify negative interactions and begin the service recovery process, ultimately resulting in a second survey to monitor the final results.

Disable prior versions

Important: This section only applies if you are upgrading from a prior version of the managed package to the latest version.
  1. In the active version of the Agent Connect Manage Package turn off the Managed Package. On the Agent Connect Configuration tab update the following settings:

    • Requests Auto Triggering — Off

    • Data Return — Off

    • Service Recovery — Off

  2. Within Scheduled Apex Jobs, delete the following jobs:

    • Stella Connect Request Sender

    • Stella Connect Job Monitor

    • Stella Connect Data Return

    • Stella Connect Service Recovery

Install the managed package

Visit the link below to begin the installation of the Agent Connect managed package:

  • (UPDATE OLD LINK) Sandbox: <link> (Version XXXX)

  • (UPDATE OLD LINK) Production: <link> (Version XXXX)

When you see the installation panel:

  1. Select "All users", check the acknowledgment box, then click Next.

  2. When prompted, grant access to 3rd party websites and continue.

  3. When the installation is complete, review the managed package to confirm that the status is "'Active".

    If the status shows "Trial", contact the Support team or your account manager to activate it. Trial integrations will be automatically disabled after 30 days.

Once installed, you will see four new applications available in the Salesforce App Launcher:

  • Agent Connect Lightning Configuration — All configuration is performed in this tab for requests, data return, and service recovery.

  • Agent Connect Requests — The Requests tab creates Request records, which contain information about the survey requests sent from Salesforce to Agent Connect.

  • Agent Connect Responses — The Responses tab creates Response records, which contain data returned from Agent Connect about completed surveys.

  • Agent Connect Scheduled Jobs — This tab stores records of all request, response, and service-recovery records created in real-time by the integration, for troubleshooting purposes.

Configure integration basics and field mapping

From the Salesforce App Launcher, open the "Agent Connect Lightning Configuration" tab to configure the integration. The first subtab of the tab requires basic information such as your Agent Connect API Keys, while the other tabs allow you to map data passed between Salesforce and Agent Connect onto fields in Salesforce records.

Continue reading for instructions to configure the first two subtabs:

  • Integration Status

  • Request Field Mapping

When you are ready, see Data return and service recovery to configure the remaining tabs.

Integration status

Start by configuring the Integration Status tab, which contains your Agent Connect API keys and some basic integration details.

Note: You may see an item named "Agent Connect Configuration" in the App Launcher. If so, ignore that item and launch "Agent Connect Lightning Configuration" instead.
image of the integration status tab

Use the following notes as a guide to configure this tab:

  • API Keys — For each set of API keys you wish to connect, click New API Keys to open the API Key Edit modal window.

    image of the API key edit window
    • API Keys Name — Enter a name, which should refer to the Agent Connect instance which is being connected to Salesforce through the integration.

    • Test API Key and Production API Key — Enter your Test and Production API Keys from the Integrations page within Agent Connect.

    • Subdomain — Enter the subdomain of your Agent Connect instance.

      As an example, if your full Agent Connect URL is blancapeak.stellaconnect.net, enter blancapeak into the Subdomain field.

      The subdomain will be used to generate links to surveys, which you can deliver directly in any channel (SMS, chat, etc.) when needed. You can find a link to a survey in the Survey Link field of the Request record created in Salesforce by the managed package.

      The subdomain also informs Salesforce of the relevant Agent Connect instances to which to send error messages in certain scenarios. These errors can then be accessed by the Medallia Support team for troubleshooting, when needed.

    Note: Most customers using a single Agent Connect instance will only require one set of API Keys. If you are using multiple instances, add the API Keys for each active instance.
  • Debug Mode — Enable Debug Mode to generate records of requests, data return, and service recovery events in the Agent Connect Scheduled Jobs tab.

  • Use Files — Select "Attachments" to allow log files to be attached directly to Scheduled Jobs records in Salesforce for troubleshooting.

  • Channel names for in-channel delivery — Enter comma-separated values representing channels in which your organization will deliver surveys directly (our example shows "sms, whatsapp, chat").

  • Email addresses for error notifications — Enter one or more email addresses to specify where error notifications should be sent.

Suppressing automatic surveys for in-channel delivery

For any channels listed in the Channel names for in-channel delivery field, Agent Connect will not send an email survey. Instead, we will provide a survey link on the Request record, which you can then use in a Flow to deliver the survey link in the customer conversation via SMS, chat or any other channel.

For example, if you enter sms, whatsapp, chat into this field, we will not deliver email surveys for interactions marked with those tags. You can then take the link from the Survey Link field on the associated Request record and provide it to the customer directly in the same channel as the interaction.

Request Field Mapping

The Request Field Mapping tab maps data from Salesforce onto the required attributes for Agent Connect surveys. The fields on this tab will be used to create Request records in Salesforce and populate important parameters in the API requests from Salesforce to Agent Connect.

Tip: If you send data to multiple instances of Agent Connect, you will need multiple field mappings. To create a new request field mapping, click the plus (+) icon near the top of the tab.
image of the request field mapping tab

Follow the steps below to configure this tab:

  1. Select the API key to use for this map.

  2. Set the Requests Auto-triggering switch to "Test" to use your Test API Key if you are not ready to move to production, or switch it to "Production" to use the Production API Key.

  3. Select the object that contains information about customer interactions.

    This will be the "case" object most of the time, unless you use a different object to contain interaction details.

  4. Select the relevant fields from the object selected in the previous step to map onto Agent Connect requests.

    All of the necessary items to map are listed on the tab, with some providing additional guidance to help you select the relevant fields. Each of these fields should be present in the object you specified in the previous step.

    For more information on the fields in this tab, see Field mappings and custom properties.

  5. (Optional) Add any custom properties you would like near the bottom of the tab, and map each custom property to a relevant field in the designated Salesforce object.

Do Not Send field

This field allows you to tag specific cases to not send a survey request. To use this field, follow the steps below:

  1. First, create a new case field (or a field on whatever object contains information about interactions) that you wish to use for the do-not-send flag.

    Once created, that field will be available in the Do Not Send dropdown menu.

  2. Select the designated field in the Do Not Send dropdown menu.

    image of the do not send field
  3. For any cases that you do not wish to trigger surveys, assign true to the designated field before the case is closed, and no survey will be sent. For all others, assign false.

    Tip: Setting the true/false value can be done manually or via Flow logic.

If you would like to configure data return and service recovery mapping now, see Data return and service recovery. You can optionally complete the remaining configuration after testing the basic integration with automated requests.

Add remote site settings

To allow Salesforce to send API calls to Agent Connect and log potential errors, you will need to add remote site settings in Salesforce to point to a specific Agent Connect endpoint.

  1. Open the Remote Site Settings page in Salesforce (Setup > Security > Remote Site Settings).

  2. Click New Remote Site.

  3. Enter a name and optional description for the new remote site, then enter https://<subdomain>.stellaconnect.net as the Remote Site URL, replacing <subdomain> with your Agent Connect subdomain.

    example remote site settings
  4. Click Save when finished.

Configure Salesforce Flows

You will need at least two Flows for the integration: one for initial survey requests and another for service-recovery interactions. Both Flows will create records in Salesforce, which will then trigger the managed package to send survey requests to Agent Connect.

Note:

The following instructions assume:

  1. The data you are sending to Agent Connect is on the Case record.

  2. You have administrator rights in your Salesforce organization.

Create initial request (Record-Triggered Flow)

The first Flow should be triggered when a case is closed with a request-type variable (or another variable if request-type is not available) set to "Initial Feedback".

  1. On the Flows page, click New.

  2. When the Flow Builder loads, click Start From Scratch.

  3. Select "Record-Triggered Flow", then click Create.

  4. Configure the Flow as detailed below:

    Start block

    The Start block will determine when this Flow will be triggered.

    example start block
    • Object — Select "Case".

    • Trigger the Flow When — Select "A record is updated".

    • Condition Requirements — Select "All Conditions are Met (AND)".

    • Conditions — Configure the conditions that will trigger this Flow. Your conditions and use case may vary based on your strategy, but in our example, we set two conditions:

      • Status = Closed

      • Request_Type_c = Initial Feedback

      With these two conditions, the Flow will run any time a case is updated to a "closed" status when the request type is specified as initial feedback. This means that after a customer interaction ends, an initial survey will be sent.

    • When to Run... — Select the first option, "Every time a record is updated..."

    • Optimize the Flow for — Select "Actions and Related Records".

    Create Records block

    The next block will create a Request record containing information about the survey request sent from Salesforce to Agent Connect.

    example create records block
    • Label — Enter a descriptive name for this block.

    • API Name — This field will be automatically populated based on the Label.

    • How to set record field values — Select "Manually".

    • Object — Select "Agent Connect Request (StellaConnect_Stella_Connect_Request_c)"

    • Set Field Values — Assign the following field values:

      • Case — Triggering Case > Case ID

      • Field Mapping to be Used — Enter the name of the Request Field Mapping to be used (our example uses "Mapping1")

        If you are sending data to multiple Agent Connect instances, you will need a way to create different records with different values in this field. See below for more information.

      • Originating Record Id — Triggering Case > Case ID

      • Processing Status — Not Processed

      • Request Type — Initial Feedback

    • Check for Matching Records — Leave this disabled.

  5. Save the Flow when finished.

If you would like to configure the service recovery Flow now, see Data return and service recovery. You can optionally complete the remaining configuration after testing the basic integration.

Flow changes when using multiple instances of Agent Connect.

This section will not apply to most clients. If you are sending data to multiple Agent Connect instances, you will either need to use separate Flows for each instance or add a Decision block in a single Flow to deliver the correct object data to the corresponding Agent Connect instance.

example decision element

On the Decision configuration page, give the element a label, API name and optionally a description. Configure an outcome for each path that would require a record to be triggered to a distinct Agent Connect instance. For example, if three Agent Connect instances are being leveraged, configure three outcomes which will align to the corresponding instance based on your business logic. ​

Once the decision and the outcomes have been configured, add a Create Records block for each outcome. In each block, change the "Field Mapping to be Used" to the appropriate request mapping that is connected to the right set of API keys.

Test and deploy the integration

To test the integration, first open the Agent Connect Lightning Configuration tab, then set the Requests Auto-triggering toggle switch to "Test" in the Request Field Mapping tab.

example of auto triggering with the test key

Your team can then continue with their standard workflows, and all surveys will be delivered with the Test API Key configured on the Integration Status tab. The test period should be long enough to experience all types of use cases and variations of the triggers you built, to ensure that they are working as intended.

This allows you to see what your customers will see when they receive a survey. You can step through the customer experience without survey responses being collected. Because no response collection occurs during testing, the data-return and service-recovery functions will not return data until the integration is moved to Production.

Important: When testing, use cases owned by a user who has an active Agent Connect profile, and make sure you have each channel you will use in Agent Connect enabled. This ensures that you can pass through the correct case origin. If the employee email delivered in the object data does not match an active profile in Agent Connect, the survey request will fail.

Test data is collected on the Test Requests tab of the API Status page in Agent Connect. You can find a link to this page on the Integrations page.

Note: Most customers use their Test API Key for testing in a production Salesforce environment. If you wish to test in a sandbox Salesforce environment, you can use your Production API Key to fully experience the integration end-to-end.

Go live in a production environment

When you are ready to move to production, set the Requests Auto-triggering toggle switch to "Production" in both field mapping tabs.

In Agent Connect, on the Integrations page (https://<your_domain>.stellaconnect.net/admin/company/api), switch the appropriate Integrated Channels to ON. This example shows that phone, chat, and email will be integrated. Turning a channel on here will remove the manual send box from the Stream.

example of enabling integrated channels

Once in Production, monitor Salesforce to ensure that requests are being created when cases are closed (or any other triggering event you've set up). You can monitor in Salesforce through the Agent Connect Requests and Agent Connect Scheduled Jobs records that were created with the installation of the package. If you encounter any issues with the integration, refer to our troubleshooting guide or reach out to the Support team.

Invalid Requests that reach Agent Connect will be listed on your API Status Page (https://yourdomain.agentconnect.net/admin/company/api/request_status) to ensure that requests have all of the required information needed to be successfully sent to your customers. If requests are appearing on the Invalid Requests tab, you'll see an error under each request that tells you why that request failed so that you can make necessary corrections in Salesforce.

Survey-eligible requests will now be delivered to customers, and responses will flow into the Stream page of Agent Connect. Interaction records will also be generated and can be viewed within the platform on the QA > Interactions page. You can alternatively export all requests in Agent Connect.