Creating a “Rate Our Services” Bot

Vassil Petev
Smartloop
Published in
8 min readApr 9, 2018
A bot built with the Smartloop Conversation Builder

One of the fairly common requests I hear when talking to clients is that they want to collect user feedback and receive proper ratings for their services. There are a few rating bot templates out there, however, I’m going to show you how to create your own “Rate Our Services” bot with Recimē.

Smartloop Conversation Builder, which provides the bot building tools, cloud infrastructure, and AI to easily build chatbots. It comes with a powerful chatbot builder, which is suited for non-technical people to create engaging AI chatbots. It also has analytics to analyze your bot performance.

The Recimē chatbot builder allows you to build flexible conversation flows, based on the answers of the user. This is the feature we will utilize today to create a rating bot for any service — in our case, we will assume it is for a hotel.

The Flow

The flow is simple:

1. The bot will ask the user whether s/he would like to rate the service (this can be done via a push notification from within the Recimē platform).

2. Depending on the answer of the user, the bot will serve one of three responses:

  • If the user responds with 1 to 3 rating, the bot will ask for additional feedback
  • If the user rates the service with 4 or 5 stars, the flow ends with a “thank you” note
  • If the user declines, the flow ends with a “sorry to bother you” note

The flow and logic of this bot are simple, but explaining how things work will take some space (no TLDR; here, sorry). Once you finish this tutorial though, you’ll be able to create such flows with ease and within minutes.

To start off, you will need a Recimē account and a bot. If you are adding this flow to an existing bot, open it. If you are just playing around, create a new bot — it is free.

1. Creating the Bot Intents

1a) We will need an intent for the initial question. Intents instruct your chatbot how to respond and are the backbone of your flow, in case you have a complex bot. Each intent is mapped to some user input, which could be pressing a button, following a link or typing a text phrase.
In this example, I have called the initial intent rate-question. This intent will contain most of our bot’s flow, which is described in the step 2 below.

1b) Since we have three different answers for the same question, we’ll need to create three more intents (we will take care of these intents in step 3 below — Creating Responses)

  • thank-you-1–3, which will handle the 1 thru 3 ratings, but will ask the user for additional feedback;
  • thank-you-4–5, which will handle the 4 or 5 ratings, then we will simply thank the user for the rating;
  • not-now, which will handle users who are not interested in the rating survey.

Here is how the intents of our sample bot look like:

An intent in the Smartloop Conversation Builder

2. Creating the Bot Flow

2a) Open the rate-question intent and go to the Expressions tab. In the Define questions or commands, type “rate” and hit enter — this is a shortcut to this intent in the live bot, which we will later use:

Adding Expressions in the Smartloop Conversation Builder

2b) Go to the Responses tab of the rate-question intent. Let’s add a welcome image for this intent (in my case I searched for “hello star gif” in Google Images and used one of the more appropriate images).
To add a welcome image, select the Image block and follow the onscreen instructions:

Adding an image block in the Smartloop Conversation Builder

2c) Let’s add the rating prompt text. While in the rate-question intent, click on the Text block to add it to the flow, then add the question “How would you rate our services on a scale of 1 to 5?”:

A text block in the Smartloop Conversation Builder

2d) Click on Add Quick Reply below the text block to add the rating buttons. In the Quick Reply dialog box, select User Input from the dropdown, add the button text and the user reply (in our case we add “1” to the user reply field, because this is the “one star” rating):

Creating quick replies in the Smartloop Conversation Builder
  • Here, the User Input selection instructs the bot to wait for a user input before moving on to the next step in the flow; in this case it will wait for a button click;
  • The entry in the user reply field will be stored in the bot’s database and can be analyzed later, if needed.

2e) Add the other Quick Reply buttons for ratings 2 thru 5 as we did in the previous step (don’t forget to mark them as User Input!). Once done, your bot should look like this in the builder:

A text block with quick replies in the Smartloop Conversation Builder

2f) We need one more Quick Reply here for all people who don’t want to rate your services. Click on Add Quick Reply, select Intent from the dropdown (this is the default selection), add a title (“Not now” in our case), and select the not-now intent we created in step 1b):

Adding quick replies in the Smartloop Conversation Builder
  • In this quick reply, selecting Intent from the dropdown instructs the bot to go to a particular intent once this button is clicked, in our case to the not-now intent.

2g) Next, we will need to train the bot, i.e. what to do when any of the 1 through 3 rating buttons are clicked. In our scenario, clicking buttons 1 thru 3 will ask the user for additional feedback — this is why we created the thank-you-1–3 intent. To push the user to the thank-you-1–3 intent when any of these buttons are clicked, add a Go To Intent block:

Go To Intent block in the Smartloop Conversation Builder

2h) Here, we will need to add two conditions here: push the user to the thank-you-1–3 intent only when the rating is equal to or higher than 1 (=>1) or when the rating is less than or equal to 3 (<=3). We will also need to add a variable name — let’s call it {{rating}}. The use of curly brackets is important for the bot function. Here is how the Go To Intent block looks like with proper setup:

Go To Intent block with conditions in the Smartloop Conversation Builder

2i) Add another Go To Intent block for ratings 4 and 5 and follow the same steps. We will use the same {{rating}} variable and push people to thank-you-4–5. Here is the setup:

Go To Intent block with conditions in the Smartloop Conversation Builder

The flow is finally ready! 👏 👏 👏

If however you test the bot now, you will see the “Sorry, I did not get you” error message(go ahead and try it). Why? Because we haven’t trained the bot what to respond for each intent! Let’s do this!

3. Adding Bot Responses

3a) In the Intents section, select the thank-you-1–3 intent. Add two text blocks: in the first one enter “thank you” and in the second one enter “Can you spend a few seconds to share your feedback?”:

Text blocks in the Smartloop Conversation Builder

These two responses will be shown to the user one after the other when the user selects 1, 2 or 3 stars. For this demo, we will not go any further with the feedback flow, but you can continue it on your own.

3b) Select the thank-you-4–5 intent. Add two text blocks with these respective texts: “Awesome!” and “Thank you for your precious time!”

Text blocks in the Smartloop Conversation Builder

3c) Select the not-now intent and add a text box with the following response “Sorry to bother you! Have a great day!”

Text block in the Smartloop Conversation Builder

4. Test the Rating Bot

Now the bot is fully functional, so feel free to play with it by clicking on the TEST THE BOT button in the bottom right-hand side corner of the Recimē chatbot builder. When the test bot pops up, type “rate” to invoke the rate-question intent:

When playing with the bot you may notice that when the user is prompted to rate the services, the user can type any number different than 1 thru 5, which throw the bot into an error:

This is easy to fix by adding validation to the user input.

5. Validating User Input

To avoid user-typed errors, we need to make sure that the bot is smart enough to not accept anything else than ratings 1 through 5 (i.e. typing “7” shouldn’t be accepted). This is easily done with the User Input block of the Recimē chatbot builder.

5a) Open the rate-question intent, scroll down and click on the User Input block to add it to the flow.

5b) In Data Type, select “number” and in Variable enter the same variable we’ve used before, i.e. {{rating}}

5c) Add the proper validation rules, i.e. More than or equal to 1 and Less than or equal to 5. Here is how the block looks like at the end:

User Input and Validation block in the Smartloop Conversation Builder

And You Are Done!

We didn’t use complex diagrams — rather everything was logical and fluent (albeit long to explain). Once you grasp the idea though, you will be doing Go To Intents, User Validations and awesome flows in no time.

Enjoy the Smartloop Conversation Builder!

Clap, clap, clap, please!!! 👏👏👏

--

--

Vassil Petev
Smartloop

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