Home / DialogFlow / Website Bots / Zobot / Dialogflow Zobot: Selection Triggers the next intent
DialogFlow | Website Bots | Zobot

Dialogflow Zobot: Selection Triggers the next intent

In this tutorial, I will explain how you can move to the next intent based on a button selection in a Dialogflow Zobot. [1]

What we are building

We will be creating a bot which provides coupons for courses on my course website (to begin with. More features will be added later).

Flowchart

Let us take a look at the flowchart for this chatbot. Please take some time to go through my article on Dialogflow flowcharts to get a background on the conventions I have used in this flowchart.

In addition to my usual conventions, I use two more conventions in this flowchart:

a) The triple slash (///) acts as a separator and indicates a new chat bubble will be used for the content after the three slashes

b) The options provided within parentheses such as (Individual Course) (Course Bundle) (Dialogflow Toolkit) are expected to be rendered as buttons in the actual Zobot

Welcome Message

I think the Zobot team should incorporate the use of the Dialogflow welcome event into their chatbots. For now, you can show a welcome message using the Trigger Response, which is configured when you create your bot.

By the way, if you haven’t already done so, make sure you use the Zobot 1-click Dialogflow integration to first connect your Dialogflow chatbot with Zobot. You can learn more about it here.

This is what I have for the CourseBot:

{
  "input": {
    "options": [
      "OK, show me the deals"
    ],
    "type": "select"
  },
  "replies": [
    {
      "text": "Would you like to see the current deals?"
    }
  ]
}

Intents

Let us now take a look at the intents one by one.

Default Welcome Intent

Notice the following:

a) the intent can fire when the user says a greeting message such as Hi or Hello

b) it can also fire when the user says “start over”

c) The custom payload message is the same as the Trigger Response that you saw earlier

Default Fallback Intent

In the default fallback intent, we provide an option for the user to restart the conversation.

show.me.the.deals

When the user clicks on the Show me the deals button, the intent below fires.

Notice the following:

a) the first message provides a link to the actual deal [by the way, yes, it is actually a real coupon and you do get a discount :-)]

b) the second message provides the option to choose a different course

c) we set an output context called await1_different_course

choose.different.course

If the user clicks on the “Choose Different course” button, this is how we handle it.

Notice

a) the input context is set as await1_different_course

b) the output context is set as await1_course_type

c) the training phrase matches the button text

d) I use an output context lifespan of 1

The user has now been presented with three different options. Here is how we handle these three options.

You can see the basic pattern repeating – set the appropriate input and output contexts, and use the button text as the training phrase.

coursetype.IndividualCourse

This is the intent which handles the user clicking on the Individual Course button

coursetype.CourseBundle

This intent handles the choice when user clicks on Course Bundle button.

coursetype.DialogflowToolkit

The following intent handles the case when the user clicks on the Dialogflow Toolkit button.

provides.IndividualCourseName.EOC

Here is how we define the intent where the user provides the name for the individual course. Notice that we are using the wildcard entity to capture the whole input.

provides.CourseBundleName.EOC

So this is the final intent we have defined, where the user provides the course bundle name. Once again, I use the wildcard entity to capture this input.

[1] By “Dialogflow Zobot”, I am referring to a chatbot integrated into Zoho’s SalesIQ live chat service using their Zobot integration. I will be referring to these types of chatbots as Dialogflow Zobots from here on.

FREE COURSES

Related Posts