How can we Help?

4. Using data dips with Talkdesk Studio


Now that we have created a new IVR greeting, set up our IVR menu options, and configured the routing settings, let’s run through a tutorial on how to use data dips with Talkdesk Studio.

Working with variables 

Variables are a critical element in Talkdesk Studio that allow you to collect data points and use them to make routing decisions.

Some components can expose data points that can be used to initialize or update some flow variables. For example, the Inbound Voice  component exposes the data points contact details, source and dialed phone numbers, and the Standard IVR component collects the keys pressed by the caller and populates the "selection" variable.

Here are some examples for using variables:  

  • Use a variable in a Play Audio component to play a personalized greeting message for a caller. For example, you can configure the waiting music that your customer listens to when they call you, so that you can be consistent in your brand management or take advantage of the time your customers are waiting to promote goods or services.
  • Use the result of a data dip in Salesforce to route VIP customers to an assignment component with a higher priority.
  • You can also configure a set of actions to be triggered during a flow execution according to time rules, or any other conditions, to automate communications to be sent to customers during or after a call.

Variables can be initialized from the initial step or via a data dip in your CRM system.

Assuming your Talkdesk account is already synchronized and integrated with your Salesforce account, let’s learn how to create a simple flow to ask users to enter a case number to route sales-related calls directly to their Salesforce case owner.

First you need to add a variable to the “source_phone” data point. We’ll explain what this is used for later:

  • Select the start_step component [1].
  • Under the Preferences tab, click on the drop-down next to “source_phone” [2].
  • Hit Add New Variable [3].
  • Type in a name for the variable* (we’ve named ours “contact_phone”).
  • Click on Add variable [4].

* Variables must always be written in lowercase, without spaces.



  • Click the Sales queue component [5] and select its Exits tab [6].
  • Expand the Send to drop-down menu for the No answer component and select Add new step [7].
  • Select Input IVR [8] from the Component drop-down menu.
  • Type in a name for this exit step: e.g., “Ask for case number.
  • Press Add Step [9].



  • Scroll down to the “Maximum waiting time reached” section in the Sales queue component.
  • Expand the Send to drop-down menu and select Ask for case number [10].
  • Scroll down to the "No match found" section.
  • Expand the Send to dropdown menu and select Voicemail [11].
  • Save your changes.

Note: You may notice that some errors appear each time you save the flow. This is normal and will continue until all steps are complete and the flow is ready to be published.



  • Click the newly created Ask for case number component [12] and select its Preferences tab [13].
  • Make sure Text to speech is selected and on the Language of audio output dropdown menu [14], select the language to be used for the new greeting (we’ve selected "English, UK" for our example).
  • On the Text to speech box [15], type in the message you want your customers to hear when they reach this Sales IVR option (we’ve used: “If you know your case number please enter it now, then press pound”).



  • Scroll down to “Keypress inputs” and select the Maximum number of digits [16] that compose the case numbers (we’ve used "8" for our example).
  • Select the Ending keypress users should use after typing in the case number (we’ll be using the “#” key) [17].
  • Scroll down to "Variables". Expand the digits drop-down menu and select Add new variable [18].
  • Type in a name for the new variable (we’ve named ours "case_1") [19] and hit the Add variable button.
  • Save your changes. 



  • Now select the Exits tab [20] for the Ask for case number component.
  • Expand the Send to drop-down menu [21] for the “Ok” section and select Add new step [22].
  • Select Salesforce data dip [23] from the Component drop-down menu. Type in a name for this exit step: e.g., “Get case owner” [24].
  • Hit Add Step [25].



  • In the “Timeout” section, specify how many seconds the system will wait for the caller’s input [26] before directing the call to a different component (or the same if applicable) [27].
  • Save your changes.



  • Click the newly created Get case owner component [28] and select its Preferences tab [29].
  • In the Query field [30] type in or paste your Salesforce Object Query Language (SOQL) query. You can search Salesforce for specific information using SOQL. A query to case object must be done with case under quotation marks eg.: SELECT Id, Owner.Email, CreatedDate FROM “Case” Where…

If you are not familiar with SOQL, please contact your CSM.

Here is the SOQL query we have used for our example:

SELECT Id, Owner.Email, CreatedDate FROM Case WHERE Status='New' AND Priority='High' AND CreatedDate=LAST_N_DAYS:7 AND (ContactPhone = '%{current_flow.contact_phone}' OR ContactMobile = '%{current_flow.contact_phone}' OR ContactFax = '%{current_flow.contact_phone}') ORDER BY CreatedDate DESC LIMIT 1

Note: You’ll notice the name of the variable (contact_phone) we created in the start_step. This means that the query will retrieve the relevant customer data by checking Salesforce for the phone number that enters your flow.

  • Hit the Retrieve Data button [31].
  • Three variables will be displayed: “Id”, “Owner.Email”, and “CreatedDate”. For example, “Owner.Email” is a field in Salesforce that refers to the email of the agent who owns the contact, so we will be using it to route the call to said agent. Expand the drop-down menu for the Owner.Email string [32].
  • Select Add new variable and type in a name for the new variable (we’ve named ours “case_owner” ).*
  • Hit the Add variable button [33] and Save your changes.



  • Now select the Exits tab [34].
  • Expand the Send to drop-down menu for the “Ok” section and select Add new step [35].
  • Select Assignment and Dial [36] from the Component drop-down menu.
  • Type in a name for this exit step: e.g., “Route to case owner.
  • Hit Add Step [37].
  • Fill out the “No result” [38] and “Error” [39] sections. This is particularly useful in case the number that is calling your company does not exist in your Salesforce account.
  • Save your changes.



Finally, let’s select and configure which attributes will be used for matching a call with an agent.

  • Click the newly created Route to case owner component [40] and select its Preferences tab [41].
  • Under “Select assignment type” make sure Agents [42] is selected.
  • Click the Variables in the flow context option [43] and expand its drop-down list.
  • Tick the boxes next to the variable(s) you want to use for matching the call with an agent: in our case, the case_owner [44].
  • Fill out the remaining sections in the Route to case owner component (the Variables section is the only one that is not mandatory), including the ones on the Exits tab.
  • Save your changes.  



Some data points collected in the flow context can also be shared with the interaction context and be displayed in the agent’s Callbar.

To enable this, simply follow these three extra steps:

  • Click the “Manage Context” option {} on the left [45].
  • Tick the boxes next to the string values to be displayed on the agent’s Callbar [46].
  • Save your changes.



  • Once your call flow is saved and validated, click Publish [47] to publish your flow.



That’s it! Our “Inbound EMEA” call flow is done and ready to be assigned to any of your account’s phone numbers. 

Have more questions? Submit a request


Powered by Zendesk