'Extracting' or 'Parsing' information from a conversation is done using special rules and custom actions, which may not be available to you by default. Contact support@leaddesk.com or your CSM for the feature to be activated.
Overview
There are several reasons you may want to collect information from a chat and save it for use. In the LeadDesk out of hours chatbot available to all Omni users, for example, when a customer tries to use the customer chat outside of hours, the chatbot will collect the customer's contact details, and email them to the customer service team.
This process has three stages:
- An intent that requests one piece of information.
- A different intent that collects that information. These first two stages may repeat several times to gather all of the information you need.
- An intent with an action to email that information to the appropriate address.
It is generally best for this process to be led, one intent directly leading to the next, until the process is complete.
Requesting the information
First, we need an intent that requests a piece of information. In Studio:
- Go to the Intents page.
- Click the Add intent button.
- Give the intent a meaningful name. You may wish to add a category or scenario to help track this flow.
- Define a necessary condition, query, or trigger that will start this process. In this example, we are responding to the customer asking to be emailed about their problem. We define a query, and some variations.
|
Saving the information
Having asked the customer for their name, we assume the next message they send will contain that information. We need a different intent to save that information to a variable. If you have followed the instructions above, you will have created an intent as part of completing the Next intent field.
- Edit the intent you created for the next intent.
- Optionally, you may want to assign the same Category or Scenario that you used on the previous intent.
- Click the Add necessary condition button.
- In the Select rule dialog, click to select Came from intent.
- Click the last_state drop-down list, and select the intent where you asked for the information.
This will ensure that the question and saving the answer always follow on logically. Now we need to save the information. In this case we use the Extract customer name rule to capture the name, there are other Extract rules for collecting other information.
- Click the add new rule link.
- In the Select rule dialog, click to select Extract customer name.
|
The Extract command saves the content of the message to a variable. In the case of the Extract customer name rule, the name is saved to the variable %customer_name.0%.
Saving other information
We repeat this step for each piece of information we want to capture, each time using Came from intent condition and the Follow up action to pass from one intent to the next.
There are various Extract rules for capturing the customer's company name, phone number and others, as well as a rule Extract variable which you can use to capture any information to a variable of your choice.
Sending an email
Collecting all of the information you need will require multiple intents. Once you reach the end of that chain it is time to do something with all of the gathered information.
The most common action is to send an email containing that information. In the intent that captures the last bit of information you need, instead of using a Follow up action, use a Custom. The action to send an email may not be available to you by default. Contact support to get access to this custom action.
Here is an example where we send collected information into an email inbox to create a ticket in Zendesk:
The payload here contains the information for the email, including the address it will be sent "to", its "subject" and the "body" includes text and variables.
- %customer_name.0% - the variable used by extract to store the customer name.
- %phone_number.0% - the variable used by extract to store the phone number.
- %email_address.0% - the variable used by extract to store the email address.
- %customer_message.0% - the variable used by extra to store the body of another message, perhaps used to capture a description of the customer's issue.
To send the whole conversation to an email address instead of just one message, you can use GJ_CONVERSATION_V1 variable which is built-in Studio.
If you need any assistance building flows that extract information, please contact us via live chat in Studio or support.chatbot@leaddesk.com.