Assigning a Call to the Same Agent

Studio provides the ability to route an interaction to an agent based on data retrieved from an external system. If a third-party system is integrated with Talkdesk, our customers can easily assign an incoming call to an agent who has previously dealt with the same contact person.

One of the simplest ways to do this is by matching the phone number the contact person is using with the phone number associated with a case in Salesforce (or other CRM). The contact person will then be connected to the agent who owns the case. If there isn’t a match, the call can be directed to a general support line, for example.

Please follow these instructions to route a call to the owner of a case in Salesforce based on the phone number of a contact person:

  1. Open the Incoming Call node and select the Preferences tab.
  2. Click on the drop-down next to "phone" and then on Create variable.
  3. Give a name to the variable. It will store the phone number that called your contact center. We’ve named it “contact_phone”.
  1. Select the Exits tab and add the Salesforce data dip node.

Note: To integrate with external systems other than Salesforce, please use the Execute Action Studio node

  1. Open the Salesforce data dip node and paste the following query:
SELECT Id, Owner.Email, CreatedDate FROM Contact WHERE Phone = '%{current_flow.contact_phone}' OR Fax = '%{current_flow.contact_phone}' OR MobilePhone = '%{current_flow.contact_phone}' OR HomePhone = '%{current_flow.contact_phone}' OR OtherPhone = '%{current_flow.contact_phone}' OR AssistantPhone = '%{current_flow.contact_phone}' ORDER BY CreatedDate DESC LIMIT 1
📘

Note

If you have given a different name to your variable (step 3), replace all instances of “contactphone” with the name of your variable.

  1. Click on Retrieve Data.
  2. Click on the Owner.Email drop-down and add a new variable with the name “case_owner”. This variable will store data if there is a match between the phone number used to call the contact center and the phone number associated with a case in Salesforce.
  1. Open the Exits tab and add the Conditional statement node under the “Ok” section.
  2. Under “No Result”, add the Assignment and dial (A&D) node and name it “Route to General”.
  3. Select “Route to General” from the “Connection error” and the "Timeout" drop-downs.
  1. Open the Conditional statement node, and select the Exits tab.
  2. Use one of the buttons AND / OR in the drop-downs in the first “Exit” to create the condition below. Either one of these options can be selected, since we're only creating one condition.
case_owner is Not Empty
  1. Under “Send to” add a new Assignment and dial (A&D) node and name it “Route to Owner”.
  2. Under “No Match”, direct the call to “Route to General” (A&D node).
  1. Open the A&D node named “Route to Owner”.
  2. Select Agents as the assignment type.
  3. Under “Select how to find agents”, choose Variables in the flow context and select "case_owner" from the list.
  1. Complete the configuration of this and the remaining nodes.
  2. Save your flow.