Looking Up Salesforce Contacts
Overview
Looking up contact information is central to improving your customer’s experience. In this section, we discuss how to look up a customer’s contact information as part of a flow using the callers’ Phone number.
Overall Flow
This tutorial requires a working knowledge of SmartFlows. For more information on SmartFlows creation and terminology, see the SmartFlows Quick Start Guide.
A basic flow that allows you to query user data from Salesforce looks like this:
Let’s look at how we created this flow.
Add Trigger Type
Select and add the trigger type required by your business flow (in the previous example, an Inbound SMS/MMS):
Format Your Numbers
Understanding how your data is stored is critical when searching in Salesforce. Phone numbers can be formatted in several ways. Some enterprises choose to have their numbers formatted with country codes (+1 555 555-1212), some include traditional special characters (555) 555-1212 ) and others just store a string of digits (+15555551212).
Phone numbers in SmartFlows are in the following format: +1NNNNNNNNNN. For best results, remove the country code from your incoming phone number. To accomplish this, use a combination of the Regex and Set (Variable) actions to provide a variable with the desired result.
We configure the Regex action with the following settings:
This provides three named REGEX groups ($REGEX_2., $REGEX_2.1, $REGEX_2.2).
-
$REGEX_2. – contains the complete search string
-
$REGEX_2.1 – contains the country code
-
$REGEX_2.2 – contains the portion of the phone number required for the search
Next, store that value in a variable of your choosing to help with readability and identification further in your flow: