How to pull data from a source in Dialogue Studio

Introduction

Another advance feature you can add to your flow is retrieving data based on input, for example customer phone number of order number. Below we will have 2 examples, first what you can do with the incoming customer uri (phonenumbe) and how to ask for an order number.

 

Configure load customer info

What we want here is to greet the customer by there name. And if we didn’t find the customer, we want to verify by letting them enter their customer number.

We already configured “Incoming conversation” and a “Say” node to greet the customer. Next, we want to see if their number exist in our data source. For this scenario we will be using SQL. This can be done by installing new pallet. For this scenario we used “node-red-contrib-mssq”.

We add the “Query” node an configure a connection to our SQL database. In the query we use the customers uri (“session.sipUri”) as a parameter to query the data to load the name.

Next, we add a “Change” node. With this node we can easily set the query output into a field. This makes next steps easier.

In the switch we check we found data. If we found data, we will continue “Say” node. But this time instead of using plain text, we are using an expression:

"Hello " & name

Anywhere365 will use the value from “name” and pronounce it using the text to speech engine.

If we didn’t find the data, we want the prompt the customer to enter their customer id. If your customer ID only contains number, you can use the “Ask and wait for input” node. But if your customer ID has letters and numbers, you need to transcript the customer using the “Transcriptor” node. With this feature the customer can say their ID and the output will be queried. The output is again stored using the “Change” node.

Next, we do another “Switch” node to check if we found data this time. If we found the customer, we will link it the positive output from the previous “Switch”.

If we still didn’t find the customer, we will prompt a message and disconnect.

 

Configure load customer case information

Additional you can also query your data source to load in information about a customer’s case information. This information can be used to inform the customer or use it to better route the customer.

Same as with the previous scenario we can either use the “Ask and wait for input” if your case number only contains numbers. But if you case number has letters and numbers; you need to transcript the customer using the “Transcriptor” node. With this feature the customer can say their ID and the output will be queried. The output is stored using the “Change” node.

The found information can be used in a “Say” node to inform the customer about the caste state:

"We found the following case with topic: " & case_name

"Your case is being handled by " & case_owner & " , we will connect to to Team " & case_team

Finally, we can use the output to route the customer to the correct skill.