Note: This article applies to Genesys Cloud for Salesforce.

After you configure the routing of Salesforce emails in Salesforce, create a flow in Salesforce using Flow Builder to automate the routing of Salesforce emails through Genesys Cloud for Salesforce. With Flow Builder, you can automate the complex process with a flow. 

A basic process for routing Salesforce emails requires two fields in the routing request: Queue or Inbound Email Flow and Salesforce Object ID (for screen pop). You can use more fields in the Flow Builder for advanced customization.

  1. In Salesforce, click Setup.
  2. Search for Flows in the Quick Find box and select Flows.
  3. Click New Flow.
  4. Select Record-Triggered Flow and click Create.
  5. Under Object, select Email Message.
  6. Under Trigger the Flow When, select A record is created.
  7. In the Set Entry Conditions section, select All Conditions Are Met (AND) as the condition requirements and add the following conditions:
    Field Operator Value
    Incoming Equals True
    ParentId Is Null False
  8. Click Done.
  9. In the Flow Builder, click the  icon to add an element.
  10. In the Add Element list, under Data, select Create Records.
  11. Under Label, enter Genesys Cloud Routing Request and select the following options for the record:
    • How Many Records to Create: One
    • How to Set the Records Fields: Use separate resources, and literal values
    • Object: Genesys Cloud Routing Request
  12. Add and set the field values for the Genesys Cloud routing request:

    Field Value

    purecloud__Queue__c

    or

    purecloud__Inbound_Email_Flow__c

    Select a queue or an inbound email flow from the list.
    purecloud__Salesforce_Object_ID__c {!$Record.ParentId}
  13. Click Done.
  14. In the Flow Builder, click Save.
  15. Enter a name for the flow and click Save again.
  16. Click Activate.

The flow is now ready to use.

You can use more than the two required fields in the Genesys Cloud routing request. Some of the fields available in the Flow Builder map to default and custom attributes. (See following table.) 

Default attributes map automatically to interaction details and, if you map activity fields in Salesforce, to activity records. For more information, see Map interaction attributes to Salesforce activity fields.

Custom attributes require configuration. For custom attributes to appear in interaction details and interaction logs, add them to the Customize Interaction Details and Activity Field Mapping sections under Client Settings in Salesforce. For more information about Client Settings, see Managed package settings

The following example shows the use of required fields, default attributes, and custom attributes to route Salesforce emails.This image shows the field values of Genesys Cloud routing request.

 

The following table describes the fields used in the example process. (*Inbound Email Flow does not appear in the example process. Use either Queue as in the example or Inbound Email Flow.)

Field Type Value Description
purecloud__Queue__c Picklist CustomerService

Required. Name of the queue in your Genesys Cloud organization that you want to receive interactions. Maps to Call.QueueName in interaction details.

Note: Use either Queue or Inbound Email Flow. If you use both, the integration defaults to Queue.

*purecloud__Inbound_Email_Flow__c Picklist RouteEmail

Required. Name of the Architect inbound email flow in your Genesys Cloud organization that you want to route Salesforce emails through.

Note: Use either Queue or Inbound Email Flow. If you use both, the integration defaults to Queue.

purecloud__Salesforce_Object_ID__c (for screen pop) Reference [EmailMessage].ParentId Required. ID of the Salesforce object that you want to screen pop when the interaction alerts. 
purecloud__Attributes__c Formula

‘CaseNumber=Case: ‘ + {!$Record.Parent.CaseNumber} + ‘,contactEmailAddress=’ + {!$Record.ToAddress}

Custom attribute that adds data to interaction details (for example, CaseNumber) and to activity records in Salesforce (for example, contactEmailAddress). Format: 'Name1=Value1,Name2=Value2'." 

Note: Because CaseNumber and contactEmailAddress are custom attributes, you must first add Participant.{CustomFieldName} to the Customize Interaction Details and Activity Field Mapping sections under Client Settings. For more information about Client Settings, see Managed package settings

purecloud__Display_Address__c String john.smith@customer.com Remote email address for the active interaction added to interaction details when an interaction alerts.
purecloud__Remote_Name__c String John Smith Remote name for the active interaction added to interaction details when an interaction alerts. Maps to Call.RemoteName in interaction details.
purecloud__Title__c String Warranty Question Email subject line added to the interaction details when an interaction alerts. Maps to Email.Subject in interaction details.
purecloud__Skills__c MultiPicklist Cellphone repair; Warranties Skills in your Genesys Cloud organization associated with agents who you want to receive interactions.
purecloud__Language__c Picklist English – Spoken Language skill in your Genesys Cloud organization associated with agents who you want to receive interactions.

The example routes Salesforce emails to the CustomerService. Agents in this queue who are assigned the skills ‘Cellphone repair’ and ‘Warranties’ and the language ‘English – Spoken’ in Genesys Cloud receive alerting interactions. 

When the interaction alerts, the field purecloud__Salesforce_Object_ID__c (for screen pop) causes a page with the ID 500360000015OCJ to screen pop in Salesforce.

The fields purecloud__Title__c (Warranty Question) and purecloud__Remote_Name__c (John Smith) are default attributes that appear in the interaction details.

The field purecloud__Display_Address__c (john.smith@customer.com) is an attribute that is mapped in the Customize Interaction Details section under Client Settings. For more information about Client Settings, see Managed package settings.

The field purecloud__Attributes__c uses custom attributes CaseNumber and contactEmailAddress to add Case: 000149 to the interaction details and to write the email address to the activity record in Salesforce. 

Interaction details using Apex code

To use these attributes with an Architect flow, see About Architect.

For more information, see Configure the routing of Salesforce emails and About Routing of Salesforce Emails.

For more information about the integration, see About Genesys Cloud for Salesforce.