Configure Oracle Workflows for CXone Agent Embedded

You can configure Search, Custom Create, and Standard Create workflows for Oracle and CXone Agent Embedded. These workflows search or create Oracle records, also called entities or objects. This is the back end configuration of dynamic data mapping.

Workflow Type

Description

Workflows

Search Search workflows scan Oracle for records that are applicable to the interaction the agent is handling. Search for ANI
Custom Search
Custom Create Custom Create workflows create any record type with both standard and custom fields. Create Custom Record
Standard Create Standard Create workflows create standard Oracle records with their standard data fields. The SNIPPET payload of these workflows must include the standard fields and only those fields. Create Asset
Create Contact
Create Incident
Create Opportunity
Create Organization
Create Task

Configure Search Workflows

There are two Search workflows: Search for ANI and Custom Search.

Configure the Search for ANI Workflow

The Search for ANI workflow uses the ANIClosed Also known as caller ID. Listed phone number of an incoming voice call. from the ACD to search all standard phone fields for matching records.

  1. In Studio, open the script where you want to configure the Search for ANI workflow.

  2. If you haven't already, add a SNIPPET action after BEGIN and before the Workflow Execute action.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC searchInput
    searchInput.workflowInput.phoneNumber = "{ANI}"
    						
    ASSIGN searchJson = "{searchInput.asjson()}"
    		
  5. Save your script.

  6. You can test your script by simulating an interaction in Studio.

Configure the Custom Search Workflow

The Custom Search workflow allows you to search for one or more Oracle records. They also allow you to search multiple fields and variables within a specified record. You can connect different search requirements using Oracle operators.

This workflow supports these Oracle records:

  • Asset

  • Contact

  • Incident

  • Opportunity

  • Organization

  • Task

  1. In Studio, open the script where you want to configure the Custom Search workflow.

  2. If you haven't already, add a SNIPPET action after BEGIN and before the Workflow Execute action.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC searchInput
    DYNAMIC payload
    payload.entity = "[API name]"
    payload.filter = "[fieldName] [operator] {variable}"
    searchInput.workflowInput.search = payload
    						
    ASSIGN searchJson = "{searchInput.asjson()}"
    		
  5. Change the value of the payload.entity attribute to the API name for the record you want to use. For example, payload.entity = "asset". This is case-sensitive.

  6. Change the value of the payload.filter attribute. This determines the search filter criteria for the record. For example, payload.filter = "phone='{ANI}'".

    1. Change [fieldName] to the name of the field you want to use to search, such as ticketNumber. This is case-sensitive.

    2. Change [operator] to the Oracle operator you want to use. A full list of Oracle operators can be found in the Oracle documentation . This is case-sensitive.

    3. Change {variable} to the variable you want assign to the field. This is case-sensitive.

  7. To add additional search filters, use an Oracle operator between the filters. For example:

    
    payload.filter = "phone='{ANI}'AND customer_number_c='{CustomerNumber}'"
    		
  8. Save your script.

  9. You can test your script by simulating an interaction in Studio.

Configure Custom Create Workflows

Custom Create workflows allow you to configure a SNIPPET payload to create any type of Oracle record, standard or custom. They also allow you to populate any field type, standard or custom. For example, you could create an Asset record with some of the standard fields from that record type, as well as your own custom fields.

This is the recommended method to create Oracle records.

Configure the Create Custom Record Workflow (Previously Create Entity)

The Create Custom Record workflow creates any type of Oracle record, standard or custom. This record can display standard and custom data fields. The fields must contain text, numbers, or variables. Binded fields are most often populated by search results or lists of options, but you can configure this workflow to add hard-coded data to a binded field.

This was previously called the Create Entity workflow.

  1. In Studio, open the script where you want to configure the Create Custom Record workflow.

  2. If you haven't already, add a SNIPPET action after ONANSWER or ONASSIGNMENT.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC createPayload
    DYNAMIC createDataArray
    						
    DYNAMIC item1
    item1.field = "subject"
    item1.value = "New Record - {CONTACTID}"
    DYNAMIC item2
    item2.field = "phonenumber"
    item2.value = "{ANI}"
    DYNAMIC item3
    item3.field = "new_contactid"
    item3.value = "{CONTACTID}"
    						
    createPayload.entity = "incident"
    		ASSIGN createDataArray[1] = item1
    		ASSIGN createDataArray[2] = item2
    		ASSIGN createDataArray[3] = item3
    CreatePayload.data = createDataArray
    
    createPayload.pinnedRecord = "[true or false]"
    						
    DYNAMIC createIncidentPayload
    createIncidentPayload.workflowInput = createPayload
    						
    ASSIGN createIncidentJson = "{createIncidentPayload.asjson()}"
    		
  5. Change the value of the createPayload.pinnedRecord attribute to either true or false. When set to true, the created record will display to agents in the Current Interactions section of the customer card. If set to false, it will display in the Recent Interactions section of the customer card. If you do not include this attribute in the payload, it will be assumed as false.
  6. To add additional fields:

    1. Create additional dynamic data objects under item3.value = "{CONTACTID}". Follow this format:

      
      DYNAMIC item#
      item#.field = "[fieldname]"
      item#.value = "{variable}"
      		
    2. Then create additional data arrays under createPayload.entity = "incident". Follow this format:

      
      ASSIGN createDataArray[#] = item#
      		

      The number (#) needs to increment by one with each additional item you add to the array.

  7. Save your script.

  8. You can test your script by simulating an interaction in Studio.

Configure Standard Create Workflows

Standard Create workflows allow users to search standard Oracle records inside Oracle.

You cannot add or delete fields in the SNIPPET payload of Standard Create workflows. If you add or delete fields, the record won't be created. To create a standard or custom record with the fields you want, use the Create Custom Record workflow.

Configure the Create Asset Workflow

Use this example script.

  1. In Studio, open the script where you want to configure the Create Asset workflow.

  2. If you haven't already, add a SNIPPET action after BEGIN and before the Workflow Execute action.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC createPayload
    createPayload.table="assets"
    createPayload.data.name ="[asset name]"
    createPayload.data.serialNumber ="[serial number]"
    createPayload.data.contact.id = [contact ID number]
    DYNAMIC product1
    product1.lookupName = "[product name]"
    DYNAMIC productArr
    productArr[1] = product1
    createPayload.data.product = productArr
    
    DYNAMIC createAssetsPayload
    createAssetsPayload.workflowInput=createPayload
    ASSIGN createAssetJson="{createAssetsPayload.asjson()}"
    		

    You must include each of those lines. If you want a field to stay blank, you can use a null value (""). For example, createPayload.data.contact.id = "".

  5. Change the values of the attributes. Any of these can be hard-coded, a variable, or a combination of these. Use a variable if you want the value to update for each interaction.

    1. Change the value of the createPayload.data.name attribute to the name of the asset. For example, createPayload.data.name = "Asset 2".

    2. Change the value of the createPayload.data.serialNumber attribute to the product's serial number. For example, createPayload.data.serialNumber = "SN0002301-2".

    3. Change the value of the createPayload.data.contact.id attribute to the contact's ID number. For example, createPayload.data.contact.id = "1234567890".

    4. Change the value of the product1.lookupName attribute to the name of the product. For example, product1.lookupName = "Smart Thermostat Z".

  6. Save your script.

  7. You can test your script by simulating an interaction in Studio.

Configure the Create Contact Workflow

  1. In Studio, open the script where you want to configure the Create Contact workflow.

  2. If you haven't already, add a SNIPPET action after BEGIN and before the Workflow Execute action.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC createContact
    createContact.phoneNumber = "{ANI}"
    createContact.firstName = "[first name]"
    createContact.lastName = "[last name]"
    createContact.email = "[email address]"
    
    DYNAMIC createContactPayload
    createContactPayload.workflowInput = createContact
    						
    ASSIGN createContactJson = "{createContactPayload.asjson()}"
    		

    You must include each of those lines. If you want a field to stay blank, you can use a null value (""). For example, createContact.email = "".

  5. Change the value of the createContact.firstName attribute to the contact's first name. For example, createContact.firstName = "Elinor". This value can be hard-coded, a variable, or a combination of these. Use a variable if you want this value to update for each interaction.

  6. Change the value of the createContact.lastName attribute to the contact's last name. For example, createContact.lastName = "Dashwood". This value can be hard-coded, a variable, or a combination of these. Use a variable if you want this value to update for each interaction.

  7. Change the value of the createContact.email attribute to the contact's email address. For example, createContact.email = "elinor.dashwood@classics.com". This value can be hard-coded, a variable, or a combination of these. Use a variable if you want this value to update for each interaction.

  8. Save your script.

  9. You can test your script by simulating an interaction in Studio.

Configure the Create Incident Workflow

  1. In Studio, open the script where you want to configure the Create Incident workflow.

  2. If you haven't already, add a SNIPPET action after BEGIN and before the Workflow Execute action.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC createIncident
    createIncident.subject = "[Incident Name]"
    createIncident.primaryContactID = "{CONTACTID}"
    
    DYNAMIC createIncidentPayload
    createIncidentPayload.workflowInput = createIncident
    						
    ASSIGN createIncidentJson = "{createIncidentPayload.asjson()}"
    		

    You must include each of those lines. If you want a field to stay blank, you can use a null value (""). For example, createIncident.primaryContactID = "".

  5. Change the value of the createIncident.subject attribute to the incident's name. For example, createIncident.subject = "Elinor's Incident". This value can be hard-coded, a variable, or a combination of these. Use a variable if you want this value to update for each interaction.

  6. Save your script.

  7. You can test your script by simulating an interaction in Studio.

Configure the Create Opportunity Workflow

  1. In Studio, open the script where you want to configure the Create Opportunity workflow.

  2. If you haven't already, add a SNIPPET action after BEGIN and before the Workflow Execute action.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC createOpportunity
    createOpportunity.subject = "[Opportunity Name]"
    createOpportunity.primaryContactID = "{CONTACTID}"
    
    DYNAMIC createOpportunityPayload
    createOpportunityPayload.workflowInput = createOpportunity
    						
    ASSIGN createOpportunityJson = "{createOpportunityPayload.asjson()}"
    		

    You must include each of those lines. If you want a field to stay blank, you can use a null value (""). For example, createOpportunity.primaryContactID = "".

  5. Change the value of the createOpportunity.subject attribute to the opportunity's name. For example, createOpportunity.subject = "Elinor's Opportunity". This value can be hard-coded, a variable, or a combination of these. Use a variable if you want this value to update for each interaction.

  6. Save your script.

  7. You can test your script by simulating an interaction in Studio.

Configure the Create Organization Workflow

  1. In Studio, open the script where you want to configure the Create Organization workflow.

  2. If you haven't already, add a SNIPPET action after BEGIN and before the Workflow Execute action.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC createOrganization
    createOrganization.name = "[Organization Name]"
    
    DYNAMIC createOrganizationPayload
    createOrganizationPayload.workflowInput = createOrganization
    						
    ASSIGN createOrganizationJson = "{createOrganizationPayload.asjson()}"
    		

    You must include each of those lines. If you want a field to stay blank, you can use a null value (""). For example, createContact.email = "".

  5. Change the value of the createOrganization.name attribute to the organization's name. For example, createOrganization.name = "Elinor's Organization". This value can be hard-coded, a variable, or a combination of these. Use a variable if you want this value to update for each interaction.

  6. Save your script.

  7. You can test your script by simulating an interaction in Studio.

Configure the Create Task Workflow

Use this example script.

  1. In Studio, open the script where you want to configure the Create Task workflow.

  2. If you haven't already, add a SNIPPET action after BEGIN and before the Workflow Execute action.

  3. Double-click the SNIPPET action on the script canvas.

  4. Copy each of the following lines of code and paste them into the Text View tab of the Editor window.

    
    DYNAMIC createPayload
    createPayload.table="tasks"
    createPayload.data.name ="[task name]"
    createPayload.data.notes.text ="[notes for task]"
    createPayload.data.statusWithType.status.lookupName = "[Not Started, In Progress, Completed, Waiting, or Deferred]"
    createPayload.data.percentComplete = [#]
    createPayload.data.priority.id = [1, 2, or 3]
    createPayload.data.organization.id = [#]
    
    DYNAMIC createTasksPayload
    createTasksPayload.workflowInput=createPayload
    ASSIGN createTaskJson="{createTasksPayload.asjson()}"
    
    		

    You must include each of those lines. If you want a field to stay blank, you can use a null value (""). For example, createPayload.data.notes.text = "".

  5. Change the values of the attributes. Any of these can be hard-coded, a variable, or a combination of these. Use a variable if you want the value to update for each interaction.

    1. Change the value of the createPayload.data.name attribute to the name of the task. For example, createPayload.data.name = "Task 2".

    2. Change the value of the createPayload.data.notes.text attribute to notes about the task. For example, createPayload.data.notes.text = "This is a test task".

    3. Change the value of the createPayload.data.statusWithType.status.lookupName attribute to the status of the task: Not Started, In Progress, Completed, Waiting, or Deferred. For example, createPayload.data.statusWithType.status.lookupName = "In Progress".

    4. Change the value of the createPayload.data.percentComplete attribute to the percent complete the task is, without the percent sign (%). For example, createPayload.data.percentComplete = 80 marks the task as 80% complete.

    5. Change the value of the createPayload.data.priority.id attribute to the task's priority:

      • 1: Low

      • 2: Normal

      • 3: High

      For example, createPayload.data.priority.id = 1 marks the task as low priority.

    6. Change the value of the createPayload.data.organization.id attribute to the ID number of the organization the task belongs to. For example, createPayload.data.organization.id = 18.

  6. Save your script.

  7. You can test your script by simulating an interaction in Studio.