Link New or Existing Case to Voice Call Record
Ease of Implementation | Medium |
Estimated Time to Implement | 40 minutes |
One of the advantages of Service Cloud Voice is that a Voice Call record is created to track every interaction. By capturing caller inputs from the IVR on the Voice Call record, you can use Salesforce automation tools, such as Process Builder, Flow, or APEX, to automatically create or link Salesforce records and display them to the rep for caller context. You can also report on caller selections.
In this example, we show you how to:
- Import a sample contact flow into Amazon Connect that updates two custom fields in Salesforce.
- Add a Salesforce flow that takes action in Salesforce based on contact flow values passed to the custom fields.
The first custom field is called IVRType. We use this field to store the calls IVR Type or selection (for example: Press 1 for a new case, Press 2 for an existing case). The second custom field, IVRInput, is used to store a customer input such as case subject or case number. The Salesforce flow creates a new case or finds an existing case and links it to the voice call record to add context for the rep.
You can modify this example to support your business processes. For example, create or find a lead instead of a case.
Prerequisites
- You must be an AWS admin with the ability to import contact flows. To learn more, see Import/export contact flows in the Amazon Connect Administrator Guide.
- You must be a Salesforce admin with the ability to install packages. To learn more, see Install a package in Salesforce Help.
Step 1: Install the Example Package
- Custom field: IVRType__c
- Custom field: IVRInput__c
- Record-triggered flow: “SCVCB - Voice Actions”
Step 2: Add Fields to the Voice Call Page
- From Setup, open the Object Manager.
- Search for and select theVoice Call object.
- Click Page Layouts.
- Select a page layout to update and add the two custom fields: IVRType and IVRInput.
- Save your work.
Step 3: Activate the Flow
- From Setup, enter Flows in the Quick Find box, then select Flows under Process Automation.
- Open the “SCVB - Voice Actions” flow.
- Click Activate. When active, the flow makes the following changes.
- When IVRType = ExistingCase, the flow finds the case that matches the case number entered in the IVR and links it to the Voice Call record.
- For any other IVRType value, a new case is created and linked to the Voice Call record.
- (Optional) Modify the flow to add more paths by adding conditions and actions to the Decision Element.
Step 4: Import the “SCVCB - RouteToAgent” Contact Flow
The “SCVCB - RouteToAgent” contact flow is similar to the “Sample SCV Inbound Flow” contact flow that
Salesforce already provides. However, we’ve removed several of the play prompts so it can be
reused with future flows. This flow creates the VoiceCall record, enables recording, and
enables transcription.
- Download the “SCVCB - RouteToAgent” contact flow from our GitHub repo.
- Log into your Amazon Connect instance.
- From Setup in your Salesforce org, enter Contact Centers in the Quick Find box, then select Contact Centers under Voice.
- In the row containing your contact center, click Telephony Provider Settings to open Amazon Connect.
- From Amazon Connect, select .
- Click Create contact flow.
- On the far right of the contact flow page, click the disclosure triangle button and select Import Flow (beta).
- Click Select and browse to the “SCVCB - RouteToAgent” contact flow you downloaded.
- In the first “Invoke AWS Lambda function” block (item 1 in screenshot), click the block to open the options and replace the function with your xxxx-InvokeTelephonyIntegrationApiFunction Lambda function. Click Save.
- In the second “Invoke AWS Lambda function” block (item 2 in screenshot), click the block to open the options and replace the function with your xxxx-kvsConsumerTrigger Lambda function. Click Save.
- In the “Set working queue” block (item 3 in screenshot), click the block to open the options and replace the queue with your queue (for example, “BasicQueue”).
- Click Publish to save and publish the flow.
Step 5: Import the “SCVCB - New or Existing Case” Contact Flow
The “SCVCB - New or Existing Case” contact flow asks the customer if they’re calling about
an existing case or if they want to create a new case.
In this contact flow, we map contact attributes to custom fields on the Voice Call record by using the naming convention “sfdc-{DeveloperName}”. We use the developer name for the custom field in Salesforce, including the “__c” suffix used for all custom fields. When the InvokeTelephonyIntegrationApiFunction Lambda function creates a Voice Call record, it looks for all contact attributes with this format and maps them to the appropriate Salesforce field.
- Download the “SCVCB - New or Existing Case” contact flow from our GitHub repo.
- From Amazon Connect, select .
- Click Create contact flow.
- On the far right of the contact flow page, click the disclosure triangle button and select Import Flow (beta).
- Click Select and browse to the “SCVCB - New or Existing Case” contact flow you downloaded.
- In the upper “Set contact attributes” block (item 1 in screenshot), click the block to view the options. Note that two contact attributes are set: sfdc-IVRType__c is set to ExistingCase, and sfdc-IVRInput__c is set to the four-digit input from the caller.
- In the lower “Set contact attributes” block (item 2 in screenshot), click the block to view the options. Note that two contact attributes are set: sfdc-IVRType__c is set to NewCase, and sfdc-IVRInput__c is set to New Voice Case. You can change this value to customize the case subject based on your business process.
- In the “Transfer to flow” block (item 3 in screenshot), click the block to view the options. Remove the existing flow and replace it with “SCVCB - RouteToAgent”, which you published earlier.
- Click Publish.
Test This Example
Here’s how to test this example.
- In Amazon Connect, from the Routing menu, select Phone numbers.
- Click the phone number you use for testing.
- Change the Contact Flow / IVR value to SCVCB - New Or Existing Case.
- Click Save.
- In Salesforce, log in to Omni-Channel so you are ready to accept calls.
- Dial the number and test the new contact flow.
- Accept the call in Omni-Channel:
- If you selected New Case, you see that a new case has been created and linked to the Voice record in the Related Record field.
- If you selected Existing Case, you see the case linked to the Voice record in the Related Record field.