Salesforce
Trigger surveys automatically and use survey data in Salesforce.
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.
For more information outside the scope of this guide, see the following articles:
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.
Upgrade from a prior version
Since the installation process for the managed package does not overwrite customized user settings, some additional configuration is needed when upgrading to Version 2.1+. The following additional steps are required:
Before upgrading:
Disable version 1.x (if applicable)
Update data return mappings
Install the new version
Add the Resend button to the Agent Connect Request list view layout
Update icons
See below for guidance on each of these steps.
Disable version 1.x (if applicable)
The two steps below apply when upgrading from Version 1.x:
On the Agent Connect Configuration tab, update the following settings:
Requests Auto Triggering — Off
Data Return — Off
Service Recovery — Off
Within Scheduled Apex Jobs, delete the following jobs, if present:
Stella Connect Request Sender
Stella Connect Job Monitor
Stella Connect Data Return
Stella Connect Service Recovery
(Before upgrading) Update data return mappings
Before upgrading, execute the Apex script provided below to verify that all required data field mappings are present or identify any missing mappings.
Follow the steps below to run the script:
Open the Salesforce Developer Console.
In the Debug menu, select "Open Execute Anonymous Window".
Paste the following Apex script into the anonymous window, then click Execute:
Boolean allValid = true; List<StellaConnect__Data_Return_Mapping__c> drMappings = [SELECT Id, StellaConnect__Mapped_Value__c FROM StellaConnect__Data_Return_Mapping__c]; List<StellaConnect__Data_Return_Map_Option__c> drMapOptions = [SELECT Name, StellaConnect__Unique_Name__c FROM StellaConnect__Data_Return_Map_Option__c]; Set<String> fieldNameSet = new Set<String>(); for (StellaConnect__Data_Return_Mapping__c mapping : drMappings) { fieldNameSet.add(mapping.StellaConnect__Mapped_Value__c); } for (StellaConnect__Data_Return_Map_Option__c mapOption : drMapOptions) { if (! fieldNameSet.contains(mapOption.StellaConnect__Unique_Name__c)) { System.debug('Data return mapping not found for ' + mapOption.Name + ' with Unique name = ' + mapOption.StellaConnect__Unique_Name__c); allValid = false; } } if (allValid) { System.debug('No issues found'); } Back in the Developer Console, double-click the new entry in the Logs tab and select the Debug Only checkbox.
Review the output for any missing or incorrect data mappings.
The example below shows two issues:
Address any reported issues in data mapping by following the steps later in this guide, then execute the script again.
If no issues remain, you should see
No issues found
in the output:
Install the new version
Follow the steps in the next section to install the latest version.
Add the Resend button to the Agent Connect Requests list view
Version 2.x introduces a new Resend button to the Agent Connect Requests list view. However, since list view layouts are based on user customizations, the new button will not appear automatically after an upgrade. Follow the steps below to add the button to the list view:
- On the Object Manager page (Setup > Object Manager), select "Agent Connect Request".
On the List View Button Layout tab, click Edit in the drop-down menu for the list view.
In the Custom Buttons section, add the Resend button to the Selected Buttons field.
Click Save when finished.
You should now see the new Resend button on the Agent Connect Requests list view. You can resend a request by selecting a row and clicking this button. If you need to resend requests in bulk, you can select as many requests as needed.
Update icons
Version 2.x also introduces a new Medallia icon to replace the previous icon, but the installation process does not overwrite the existing icon automatically. Use the steps below to update it manually:
- On the Custom Tabs page (Setup > Tabs), in the Custom Object Tabs section, click Edit on one of the Agent Connect entries.
Next, click within the Tab Style field to open the Tab Style Selector window.
Click Create your own style.
In the window that appears, click Insert Image, then select the "Medallia Logo Small" file in the Stella Connect folder.
The file will already be present after installing the managed package.
Click OK to move on, then save the changes to the tab.
Perform the preceding steps for both the Agent Connect Requests and Agent Connect Responses tabs on the Custom Tabs page.
You should now see the Medallia logo on each of the tabs in the integration.
Install the managed package
Follow the links below to begin the installation of the Agent Connect managed package:
When you see the installation panel:
Select "All users", check the acknowledgment box, then click Next.
When prompted, grant access to 3rd party websites and continue.
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.
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.
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.
If you are upgrading from a previous version of the managed packaged, your existing API Keys can still be used in the new version. However, you will need to configure the new Subdomain field for the existing keys.
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.
If you use Salesforce's Messaging In-App and Web feature for chat, and you would like to send those interactions to Agent Connect, see Messaging for in-app and web for additional instructions.
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.
Follow the steps below to configure this tab:
Select the API key to use for this map.
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.
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.
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.
(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:
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.
Select the designated field in the Do Not Send dropdown menu.
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.
Open the Remote Site Settings page in Salesforce (Setup > Security > Remote Site Settings).
Click New Remote Site.
Enter a name and optional description for the new remote site, then enter
as the Remote Site URL, replacinghttps://<subdomain>.
stellaconnect.net
<subdomain>
with your Agent Connect subdomain.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.
The following instructions assume:
The data you are sending to Agent Connect is on the Case record.
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".
On the Flows page, click New.
When the Flow Builder loads, click Start From Scratch.
Select "Record-Triggered Flow", then click Create.
Configure the Flow as detailed below:
Start block
The Start block will determine when this Flow will be triggered.
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.
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.
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.
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.
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.
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.
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.
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.