Customizing a Conversation Flow Based on User Input

A Smartloop Conversation Platform Step-by-Step Tutorial

Vassil Petev
Smartloop
5 min readSep 16, 2018

--

Chatbots are not only cool for chatting to humans, but they can also help you to profile your users, to re-target them, and to create tailored conversation flows based on user inputs, such as answers to pre-defined questions.

In this tutorial you will learn how to:

  • Set up your first Smartloop chatbot (and account)
  • Create different chatbot flows, based on different user inputs

Notes:

  • This tutorial doesn’t require previous programming knowledge
  • All screenshots and flows explained in this article are done with the Smartloop chatbot platform.
  • Everything in this article is valid for all channels that Smartloop supports for publishing chatbots on: website, Messenger, Viber, etc.

Let’s start with a use case: let’s suppose that we want to understand whether a user is interested in watching TV, going to the movies or attending live performances (plays). Based on his/her interest, the chatbot will offer a customized flow that’s relevant to the user’s interest.

Set Up Your Smartloop Chatbot (and Account)

(if you already have a Smartloop account, please move on to the next section)

1. Head to the Smartloop website
2. Click SIGN UP at the top of the screen

Smartloop chatbot website

3. Follow the instructions to setup your account. This step takes less than a minute.
4. Log in your new Smartloop account (feel free to go through the onboarding tutorial).
5. Once you are in the Smartloop dashboard, click on “Create a new bot” and enter the required info. In my case, I’ve entered “User Data Collection Bot” as the title and description, my channel is Facebook, and the bot language is English:

Smartloop chatbot platform

Feel free to go through the new onboarding tutorial.

Setting up the Chatbot Flow

Our flow will consist of one question (“What is your interest?”) and three responses (TV, movies and plays). Let’s create the three responses first.

1. Create a block and call it TV. This block will contain the bot’s TV-related response. Add a TEXT card to it and add some TV-related response:

2. Create another block and call it Movies. Add a TEXT card to it and add a movie-related response:

3. Create another block and call it Plays. Add a TEXT card to it and add some TV-related response:

4. The final block that we will add will have all our conversation logic. Let’s create it and call it Interests.

5. In this block, add a User Input card — this card will store all user interests in the platform. Set the Data Type to Text and the Variable to {{interest}}:

6. Here the Validation will be Pattern. This validation will help us keep people within the three predefined responses (TV, movies, plays). A new field will appear, called Expression. In this field we will enter the responses in the following manner:

(?:TV|movies|plays)

The line above instructs the bot that there are only three possible choices to be made by the user:

You also have the option to enter a message in case the user enters something else.

HINT: If you want to expand these choices later on, just separate them with a vertical line:

(?:TV|movies|plays|4D|Playstation)

7. It is finally time to add the question. Add a Button Template card which will contain the question and the possible answers:

8. Let’s add the answers, the first being “TV”. Click on + Add Button, change the action to “User Input”, enter “TV” as title, and enter “TV” as “user reply”. Here is the setup for TV:

9. Repeat step 8 for Movies and Plays, where the respective entries are “Movies” and “Plays” under “user inputs” and “user replies”:

10. Now, drag the Button Template card before the User Input card and drop it there by using the Reorder button:

This is necessary, because when the User Input card is used, the chatbot will expect input from the user. If it is at the very top of the flow, the user will never see the question.

11. So far, we’ve programmed the bot to collect and store the user interests, but we need to instruct it what to do after that. To do this, we’ll use the Go to Block card. Let’s add one for TV and set the conditions as follows:
a. In Variable, enter {{interest}}
b. Select the equal sign
c. In Block name, select TV:

12. Add two more Go to Block cards for movies and plays respectively:

13. While still in the Interests block, go to the Expressions tab and add a keyword which will allow us to call this block from the chatbot and test how it works. Go to the Expressions tab and enter interests as a keyword:

14. Hit Refresh in the chatbot and go through the name flow. Once it ends, type interests and hit Enter — this will start the Interests flow:

That was all. Feel free to play around with this bot and customize the flows even more. If you deploy this chatbot, and once you gather enough responses, you will also be able to target users who have particular interests with tailored messages.

Questions? Comments? Let me know in the comments below.

Enjoy the Smartloop chatbot platform!

--

--

Vassil Petev
Smartloop

Product geek, product manager, product marketer. Loves tech, sailing, skiing and DJing.