Set Up Data Memorialization for CXone Agent Embedded

Data memorialization allows for ACD data from CXone to be mapped to specified fields in the CRM record. Only text is mapped; attachments, images, and notes cannot be mapped. Currently, you can set up data mappings for standard CRM entity types.

Data memorialization happens after the interaction ends. For voice interactions, this is when the call ends and the agent completes ACWClosed State that allows an agent to complete work requirements after finishing an interaction time, if configured. For digitalClosed Any channel, contact, or skill associated with Digital Experience. interactions, this is when the agent changes the statusClosed Result assigned by the agent or system at the end of a voice (disposition) or digital (status) interaction. of the interaction to Closed and saves it.

Create a CRM Integration in CXone

If you haven't already, integrate Microsoft Dynamics, Oracle, ServiceNow, or Zendesk with CXone Agent Embedded.

Create a Data Mapping in CXone

Required permissions: Configurations Edit; Data Memorialization Create

  1. In CXone, click the app selector and select Agent Integrations.
  2. Click on an authenticated CRM configuration to open it.
  3. On the Data Memorialization tab, click New Data Mapping.
  4. Enter a Name. You can optionally enter a Description for the mapping.
  5. Add a CRM entity to map.

    1. In the Select Entity Type drop-down, select the CRM entity type for the data you want to map. The entity type is the CRM record type, such as Case or Contact.

    2. Click Add Entity.
    3. To add more CRM entities, repeat steps A and B.
  6. Configure field mapping. You can configure multiple data fields per entity. 

    1. In the External CRM Field drop-down, select the CRM record field you want to map to CXone.

      If you want to map the full transcript of an interaction, select a CRM record field with proper formatting and a large enough character limit. If the field doesn't meet these requirements, only part or none of the transcript is displayed, depending on the CRM.

    2. In the Select Channel drop-down, select the channel related to the data you want to map.

    3. In the CXone Data drop-down, select the CXone data field you want to map to your CRM.

    4. To add more data fields, click Add Field.
  7. If you are setting up data memorialization for Salesforce, you can link an active Salesforce record to a created record. When the interaction ends, the last active record that is opened will be mapped to the selected record. To enable this, add these field mappings:
    1. Click Add Field.
    2. In the External CRM Field drop-down, select Name ID or Relates To.
    3. In the Select Channel drop-down, select Script Variable.
    4. If you selected Name ID in the External CRM Field drop-down, enter whoid in the CXone Data field. This maps to Contact and Lead records.
    5. If you selected Relates To in the External CRM Field drop-down, enter whatid in the CXone Data field. This maps to all other standard Salesforce records, such as Account, Case, and Opportunity.
  8. Click Save at the top of the page. The active data mapping appears in the Data Memorialization tab.

Create a Studio Script

Integrating your CRM with CXone Agent Embedded requires a Studio script. The script connects CXone Agent Embedded and the CRM. It's how you define the specific workflows you want agents to use. Finally, the script moves data between the CRM and CXone Agent Embedded when the agent uses the workflow behavior.

If you use Desktop Studio, you can find the Workflow Execute, Agent Workflow Configuration, and CustomEvent actions on the Framework tab. If this tab isn't visible, your CXone Account Representative can enable it for you.

This task may require coordination with your organization's Studio scripter.

Download an example of this script.

Multiple Workflows in One Script

You can use one script to handle multiple workflows. If you want to include more than one workflow, you need to: 

  • Create scripting logic to define when and how each workflow is available to the agent during an interaction.
  • Use one Workflow Execute action for each workflow. Configure each one with the variable for the workflow it handles.
  • Add variables for each workflow to the first Snippet action. Each workflow needs to have its own [workflow_name]workflowID variable, [workflow_name]Input dynamic data object, and [type]Json variable. The dynamic data object must include the workflowInput.phoneNumber="{ANI}" parameter.
  • Create a [workflow_name]WorkflowOutputJson variable in the second Snippetaction for each workflow in the script.
  • Create a set of parameters in the workflowRequest object for each workflow in your script. Change the request[#] index number by increasing it by one for each additional workflow you add. For example:

    // Search workflow
    workflowRequest.request[1].workflowType = "Search"					
    // Create Timeline workflow						
    workflowRequest.request[2].workflowType = "CreateTimeline"
    //Edit workflow						
    workflowRequest.request[3].workflowType = "Edit"	

Create the Script

In the following steps, some variables and objects are named for the search entity workflow. If you use a different workflow, use names that identify the workflow you're using. If you change the names of variables and objects, be sure to update the name everywhere it appears in the script.

  1. In Studio, create a phone script.
  2. Add the following actions and connect them in the order given using the Default branch condition. The script has two parts. The first part creates the workflow payload and requests an agent. It contains these actions: 

    • Begin: The required starting action for every script. This action doesn't require any configuration.
    • Snippet: This is the first Snippet action in the script. It contains custom code that defines the workflow inputs and payload.
    • Workflow Execute: This action executes a workflow. You must have one instance of this action in your script for each workflow you include.
    • Reqagent: This action requests an agent who has a specific ACD skill.

    The second part of the script starts when the agent answers the interaction. It connects the workflow to CXone Agent Embedded and moves data back and forth. It contains these actions: 

    • Onanswer: This event action triggers when an agent answers the interaction. This action doesn't require any configuration unless you need to change the name of one or more of the variables in the action properties.
    • Snippet: This is the second Snippet action in the script. It passes information to the CustomEvent action.
    • CustomEvent: This action performs a second-level search when the agent clicks Search. It displays additional information in CXone Agent Embedded.
    • Agent Workflow Configuration: This action executes a workflow action when the agent manually triggers it in the agent application. You can configure up to three workflow actions and assign the workflow that executes for each one.
  3. Configure each Studio action as described in the remaining sections on this page:

  4. Connect the other branches of the Workflow Execute action, Agent Workflow Configuration action, and the CustomEvent action. The links in this step are for each action's online help, which describes the branches.

  5. Add other scripting logic as needed.

  6. Save your script often as you make changes.

  7. When the script is complete and thoroughly tested, put it into production.

Configure SNIPPET Action #1 (Workflow Inputs)

  1. Double-click the SNIPPET action on the script canvas.
  2. Add the following code to the Text View tab on the Properties window.

    
    //this is the ID of the CRM integration from the CXone Agent Integrations page
    ASSIGN integrationConfigId="[integration configuration ID]"
    
    //This is the ID of the workflow you want to use
    ASSIGN searchWorkflowId="[workflow ID]"
    
    DYNAMIC searchInput
    searchInput.workflowInput.phoneNumber="{ANI}"
    //Include the following variable if you want to establish a timeout.
    //Connect the OnTimeout branch of the Workflow Execute Studio action if you create a timeout. 
    searchInput.timeoutMilliSec = "6000"
    
    ASSIGN searchJson = "{searchInput.asjson()}"			
    			
  3. Configure the following parts of this code:

    • integrationConfigurationId: Defines the CRM this script communicates with. Replace [integration configuration ID] with the configuration ID copied from the Agent Integrations Configurations page in CXone.
    • searchWorkflowId: Defines the CRM workflow used in this script. Replace [workflow ID] with the ID of the workflow you want this action to use. Copy it from the Agent Integrations Configurations page in CXone.

    • searchInput: A dynamic data object that holds the contact's ANIClosed Also known as caller ID. Listed phone number of an incoming voice call.. It also holds the payload that's returned from the CRM and passed to CXone Agent Embedded. You don't need to change this value.

    • searchJson: A variable that holds the contents of the searchInput object in JSON.  You don't need to change this value.
  4. Select the Snippet action on the script canvas and click the Properties tab in Studio.
  5. Enter Workflow Requests in the field for the Caption property. This changes the label of the action on the script canvas.

WORKFLOW EXECUTE Action Configuration

If you want this script to handle more than one workflow, you need one Workflow Execute action for each workflow. For example, you could have different workflows that run depending on the ACD skillClosed Used to automate delivery of interactions based on agent skills, abilities, and knowledge. Configure the script to suit the needs of your organization. Configure each Workflow Execute action as described in these steps.

  1. Select the Workflow Execute action on the script canvas and click the Properties tab in Studio.

  2. Configure the following properties of the variables from the first Snippet action. If your script has multiple Workflow Execute actions, configure each one with a different workflow.

    • configurationId: Enter the name of the variable that holds the configuration ID. Format it with curly braces ( { } ). For example, the variable used in the example script is {integrationConfigId}.
    • workflowID: Enter the name of the variable that holds the workflow ID. Format it with curly braces ( { } ). For example, the variable used in the example script is {searchWorkflowId}.
    • workflowPayload: Enter the name of the variable that holds the workflow payload that this action handles. Format the name with curly braces ( { } ). The payload must be converted into JSON. In the example script, this field is set to {searchJson} because the Workflow Inputs Snippet declares the searchJson variable with the value {searchInput.asjson()}.
    • Sequence: Define what the contact hears as they wait for the workflow to execute. This can be:

      • A text-to-speech audio prompt.

      • A pre-recorded audio prompt.

      • A custom music file. The default music files that you can use with the Music action aren't available in the Workflow Execute action.

      You can enter the prompt or name of the audio file in this property, but you must use proper formatting. You can also use the Sequence Editor, which is accessible from the Play action. Add Play to your script and create the prompt, then copy the contents of the Sequence property and paste it into the Workflow Execute action's Sequence.

    • Phrase: Use this property to document the text the prompt contains. This property is not used by the script. Because some prompts can be complex and contain multiple segments, it can be helpful to include the text written without the formatting required by the Sequence field.
    • resultSet (out): Enter the name of the variable that you want to hold the result of the specified workflow. The example script handles a search work flow. This field is set to workflowResultSet. This field does not require curly braces.
    • errorArgs (out): Enter the name of the variable to hold information about the error. In the example script, this field is set to workflowErrorSet. You don't need to format the variable name with curly braces.
    • Caption: Change the action's caption to the name of the workflow it handles. This is especially important in scripts that handle more than one workflow. For example script, the caption would be Search.

REQAGENT Action Configuration

  1. Select the Reqagent action on the script canvas and click the Properties tab in Studio.

  2. Configure the ACD Skill property with the skill you want the script to route interactions to. Configure the other properties of this action as needed.

Configure SNIPPET Action #2 (Workflow Response)

  1. Double-click the Snippet action on the script canvas.
  2. In the Editor window, add the following lines of code:

    
    // WorkflowResult Out parameter from workflow execute action
    workflowResultSet.contactId = "{ContactID}"
    ASSIGN searchWorkflowOutputJson = "{workflowResultSet.asjson()}"
            
  3. Enter Workflow Response in the field for the Caption property. This changes the label of the action on the script canvas.

Configure the CUSTOMEVENT Action (Send Workflow Response)

  1. Select the CustomEvent action and click the Properties tab in Studio.
  2. Configure the following properties of the first action with the following settings:

    • TargetAgent: {Global:__agentId}. This variable includes two underscore characters in a row.
    • EventName: AgentWorkflowResponse. This field is case sensitive and must match exactly.
    • Data: {searchWorkflowOutputJson}.
    • Caption: Send Workflow Response. This changes the action's label on the script canvas.

Configure the AGENT WORKFLOW CONFIGURATION Action

  1. To launch the Custom CRM Configurations page, double-click the Agent Workflow Configuration action in your script. To launch the Custom CRM Configurations page, select the Agent Workflow Configuration action in your script and click Open Editor in the action's properties.

  2. On the Agent Configuration window, select the Custom CRM Configuration you want this Agent Workflow Configuration action to use. The drop-down displays the names of all configured integrations in your CXone environment.
  3. Select one or more Actions that you want agents to be able to perform when this script runs.

  4. In the Workflow Mapping section, select the workflows that you want to assign to the Actions you selected. You can only select one workflow per action. The Action column shows which action each workflow option corresponds to.

    The following example image shows the workflows available for ServiceNow. If you use a different CRM, the options will be different.

  5. If you want to change a workflow mapping, clear the first selection before choosing a new workflow. If you want to remove all selected mappings, select the checkbox in the column header.
  6. Click Apply.
  7. Verify your selections on the Custom CRM Configurations Updated window. If you need to change a selection, click Go Back and make your change.
  8. Click Close on the Custom CRM Configurations Updated window to apply your selections to the Agent Workflow Configuration properties.

Copy a Configuration ID from CXone

When creating the Studio script for your CRM integration, you need configure some of the actions with IDs from the Agent Integrations page in CXone. The Connector Mappings tab is visible on this page only if you have authenticated the integration.

  1. In CXone, click the app selector and select Agent Integrations.
  2. On the Configurations page, click the configuration you want to use in your script.
  3. On the Connector Mappings tab, copy the ID you need:

    • If you need the integration's configuration ID, click Copy under Configuration ID.
    • If you need a workflow ID, locate the workflow you need by ID or Name in the Workflow section and click Copy.

  4. Paste the copied ID into the appropriate Studio action property field or snippet code.