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:

A sample workflow with five actions

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 Text):

From the Actions menu, Inbound Text, fourth from the top of the list, is highlighted

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:

On the left the Regex action is selected within the flow, and on the right the configuration panel shows sample Regex configuration

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:

On the left the Set action is selected in the flow, and on the right sample values are shown in the configuration panel