Send survey results to LivePerson
After receiving and processing a survey for a LivePerson interaction, Medallia Experience Cloud can send key survey results to LivePerson using the OmniExporter as a webhook. OmniExporter is a service that uses HTTP to pass survey record data to external systems.
To setup the webhook to send data to LivePerson, create an OmniExporter in Medallia Experience Cloud setup. You will need
-
LivePerson account ID
-
LivePerson login OAuth URL and credentials
-
Names of the survey fields to send to LivePerson, and the matching names of the LivePerson fields to receive the data
Trigger
| Trigger property | Value |
|---|---|
| Trigger by | Field value changes |
| Data object | Survey |
| Trigger an event on record UPDATE | On |
| Triggering fields | e_bp_cc_liveperson_enrichment_completed_yn |
| Matching condition |
|
Login settings
| Login property | Value |
|---|---|
| Login Method | OAuth |
| Login URL Type | Static |
| Login URL |
|
| Login Headers Type | Static |
| Login Headers |
|
HTTP Request Assembly
| HTTP Request Assembly property | Value |
|---|---|
| HTTP Method | POST |
| URL Type | Static |
| URL |
|
| Headers Type | Static |
| Headers |
|
| Fields used in the action | Select the survey fields to send to LivePerson. Minimally include:
|
| Body Type | JavaScript |
| Body | JavaScript code to build a JSON payload to send to LivePerson. |
The JavaScript in the request body needs to return a JSON payload that maps the survey field values to their corresponding LivePerson fields, similar to this:
// Get fields for the record to be sent
var entities=data.changedEntities;
// Set entity for readability
var entity = entities[0];
var consumerId = entity.e_bp_customer_id_txt;
var conversationId = entity.e_bp_cc_liveperson_conversation_id_txt;
// Add your survey program's CSAT Field below (If it is not 5 scale then convert it to 5 scale in a k-field and use that instead)
var csat = entity["ADD_CSAT_FIELD"] + "";
var request =
{
"lpConversationId": conversationId,
"lpConsumerId": consumerId,
"csat": csat
}
write (JSON.stringify(request));
HTTP Response
After sending the survey response, LivePerson returns a JSON payload that contains the LivePerson field values for the chat record. By setting up a response processor, the LivePerson values can be inserted into the Medallia Experience Cloud record.
The JavaScript in the response processor returns a JSON payload result that maps the LivePerson field values to their corresponding Medallia Experience Cloud fields, similar to this:
var responseStatusCode = JSON.parse(http.getResponseStatusCode());
var job={};
var record=data.changedEntities[0];
// Successful call
if(responseStatusCode == '200'||responseStatusCode == '201'||responseStatusCode == '204'){
job={
"medalliaId" : record.a_surveyid,
};
}
write(JSON.stringify([job]));
