Enable Agents to Manually Create Salesforce Records in Agent

You can enable agents to manually create new Salesforce records from inside CXone Mpower Agent while they're handling interactions. Agents can click Create New a plus sign. in the Related Interactions section of the customer card and select the type of record they want to create. The form to create the record then appears in Salesforce.

To enable this, you need to modify your Studio script. Your organization's CXone Mpower administrator, agent application administrator, and Studio scripter may need to coordinate to complete this task.

Complete each of these tasks in the order given.

Before You Begin

Download Template Script

Download this folder of template scripts. It contains voice and digitalClosed Any channel, contact, or skill associated with Digital Experience. scripts for CXone Mpower Studio and Desktop Studio.

Add Actions to Your Script

Modify your existing script for the channelClosed Various voice and digital communication mediums that facilitate customer interactions in a contact center. you're working with.

In Desktop Studio

  1. Log in to Studio.

  2. Click File > Import from File. Select the voice or digital template script for Desktop Studio.

  3. Open the script you want to modify.

  4. Copy these actions from the template script and paste them where they belong in your existing script:

    Action Caption
    SNIPPET Snippet for Manual Create
    CUSTOMEVENT Agent Workflow Create Payload
  5. Save your script.

In CXone Mpower Studio

  1. In CXone Mpower, click the app selector and select Omnichannel RoutingStudio Three arrows joined at the base. One points straight up, one up and to the right, and one up and to the left. .
  2. Click Load Script. Select the voice or digital template script for CXone Mpower Studio.

  3. Open the script you want to modify.

  4. Add these actions to your script:

    Action Caption
    SNIPPET Snippet for Manual Create
    CUSTOMEVENT Agent Workflow Create Payload

    Copying actions between scripts isn't yet supported in CXone Mpower Studio.

  5. Copy the code from the SNIPPET action in the template script and paste it into the corresponding SNIPPET action you added to your script.

  6. Save your script.

Customize Studio Actions

Snippet for Create During Interaction

This step involves configuring JSON in the SNIPPET action. Use the template provided in the SNIPPET action in the template script. Once completed, the JSON should look similar to this:

JSON with four sections: workflows, payloads for the workflows, array for the payloads, and information for CUSTOMEVENT action.

  1. If you're using Desktop Studio, double-click the SNIPPET action in your script named Snippet for Manual Create.

  2. If you're using CXone Mpower Studio, select the SNIPPET action in your script named Snippet for Manual Create and click Open Editor in the action's properties.

  3. Add the Salesforce Create workflow for the record type you want agents to be able to manually create. It is highly recommended you use the Create Custom Record workflow. To enable agents to manually create more than one type of record, include more than one workflow.

    Do not include the last three lines of the workflow, beginning with DYNAMIC create[RecordName]Payload. You will create a payload for the workflow in the next step.

    1. Configure each workflow according to the steps for that workflow.

    2. To cache the created record so that it appears in the customer card while the interactionClosed The full conversation with an agent through a channel. For example, an interaction can be a voice call, email, chat, or social media conversation. is active, set cacheResponse to true, as shown below.

      
      createPayload.cacheResponse = "true"
      		

      To prevent the created record from appearing in the customer card, set cacheResponse to false.

      If you include cacheResponse = "false", the record will not be pinned or displayed as a screen pop, even if pinnedRecord and screenPop are set to true.

  4. Create a payload for each workflow you included. Copy and paste the code below, then configure it.

    
    DYNAMIC create[RecordType]Payload
    create[RecordType]Payload.workflowInput = createPayload
    create[RecordType]Payload.display = "[Display name]"
    create[RecordType]Payload.configurationId = "[CRM Configuration ID from CXone Mpower]"
    create[RecordType]Payload.workflowId = "[Workflow ID from CXone Mpower]"
    		
    1. On each line, change the [RecordType] placeholder to the record type for the workflow. For example, if this is the payload for the Create Contact workflow, your first line would be DYNAMIC createContactPayload.

    2. Change the value of the create[RecordType]Payload.workflowInput attribute to match the dynamic data object for the workflow. If you used createPayload, you do not need to change this value.

    3. Change the value of the create[RecordType]Payload.display attribute to the name you want to appear to agents. For example, if you enter createContactPayload.display = "Contact", the agent will see an option for Contact when they click Create New a plus sign. in the customer card. This value must be 15 characters or less.

    4. Change the value of the create[RecordType]Payload.configurationId attribute to the CRM configuration ID for your Salesforce configuration.

    5. Change the value of the create[RecordType]Payload.workflowId attribute to the workflow ID of the Create Custom Record workflow.

  5. Create an array for the payloads. Copy and paste the code below, then configure it.

    
    DYNAMIC list
    list[1] = create[RecordType]Payload
    list[2] = create[RecordType]Payload
    		
    1. On each line, change the [RecordType] placeholder to match the workflows you configured in step 4. For example, if you included the Create Case workflow and the Create Contact workflow, your code would be:

      
      DYNAMIC list
      list[1] = createCasePayload
      list[2] = createContactPayload
      		
    2. If you included only one workflow, delete the third line in the code.

    3. If you included more than two workflows, add additional lines following the pattern: list[3] = create[RecordType]Payload, list[4] = create[RecordType]Payload, and so on.

  6. Provide the necessary information for the Agent Workflow Create Payload CUSTOMEVENT action. Copy and paste the code below.

    
    DYNAMIC data
    data.list = list
    data.id = "{contactId}"
    
    ASSIGN agentWorkflowCreatePayloadData = "{data.asjson()}"
    		
  7. Save your script.

Agent Workflow Create Payload

  1. Select the CUSTOMEVENT action in your script named Agent Workflow Create Payload.

  2. In the properties pane, configure the CUSTOMEVENT action's properties to match these values:

    • The TargetAgent property should be set to:

      • {__agentId} for voice.

      • {agentid} for digital.

    • The EventName property should be set to AgentWorkflowCreatePayload.

    • The PersistInMemory property should be set to True if you're using Desktop Studio and On if you're using CXone Mpower Studio.

    • The Data property should be set to {agentWorkflowCreatePayloadData}.

  3. Save your script.