Retail

Template overview

This template serves as a basis for building a chatbot for your own retail business. With this bot your users can track their orders, request a return, get shopping recommendations, locate the nearest branch of your business, and give feedback. Each of these use cases is contained in a separate flow.
Keep reading to learn how you can customise this template for your own organisation.

How to customise this template

Make sure to always update the NLP after loading a template!
This template uses two third party services:
  1. 1.
    Airtable, as a database for customer orders
  2. 2.
    Google Maps API, for finding the nearest post office
To let your bot interact with these services you will need an API key for each and configure these in the Action dialogs where the bot makes the API calls.
Using another service to manage your customer orders? You can link any type of database to this bot, as long as it has an API. Read more about our API integrations here.
Below is an overview of all dialogs you will need to customise in this template. It will walk you through how to configure the connection with the Airtable and Google Maps APIs, as well as some other tips to customise this template for your business.
Let's get started!

Flow: General

Dialog: Introduction

This is the first message the user sees. Modify it to give your bot a custom welcome message that fits your business’ tone and style; also make sure to replace Sneaky Trainers with your own business’ name.

Dialog: Support topics

This dialog shows the topics the bot can help your users with.
If you add use cases to your bot you can add a button here to redirect to that flow.

Dialog: Not understood 1 & Not understood 2

These dialogs use a counter to keep track of how many times it has not understood a user's message. If it’s the first the time the bot didn’t understand the message it will ask to rephrase the message; if it’s the second time the bot doesn’t understand it, the bot will ask the user if they would like to get in touch in another way.
For more information on the Not understood counter, check out the tutorial here.
If you want to increase the number of times the bot asks the user to rephrase before offering the option to get in touch, you can increase the value of the not_understood_counter variable. That variable is set to 1 in the first Go To condition in the Not Understood dialog. You can add additional not understood messages by adding a Go To condition and linking a bot dialog to it

Flow: Tracking

This flow allows your customers to check the delivery status of their order. The bot will look up the delivery date in an external database based on the order number. If the customer doesn’t know their order number, the bot will ask for their name and email address and use those to look up the order status.

Dialog: Search order number

If the user gives their order number, this Action dialog looks up the record that matches the order number in an external database. By default, this template is set up to look up the orders in an Airtable base using the Search Record function of Chatlayer’s Airtable integration.
Already using another service to to manage your orders? You can link any sort of database to this bot, as long as it has an API. Read more about integrations here.
You will need to customise this dialog by connecting it to your own Airtable account and your own Airtable base, or another database of your choice. However, when you have newly imported the Returns template, it will be linked to this Airtable. The order data is in the customerorders table.
Feel free to use this base as an example for testing, but make sure to connect your own database once you start using the bot for your own business.
If you do not yet have an Airtable account set up in Chatlayer, you can do so by clicking Connect new account and following the steps in the pop-up window. For this you will need your Airtable API key which you can find on your Airtable account page.
Once you have set up your own Airtable base, head back to the dialog in Chatlayer. In the Base field replace the ID of the example Airtable base with the ID of your own Airtable base. In the Table field replace the example ID with the ID or name of the table in your own Airtable base where you store the order data. You can find your Airtable's base ID and table IDs here.
If a record matching the order number is found in the Airtable, the matching record will be saved as an object in your chatbot’s session data. You can can call data from this object in your bot dialogs with the following format:{apps.airtable.read_record.(AIRTABLE_FIELD_NAME)}. For example the Status Delivery dialog show the order’s delivery date using {apps.airtable.read_record.DeliveryDate}.
You can find more information on how to integrate Airtable into your chatbot here.

Dialog: Search email in database

This Action dialog is nearly identical to the Search order number in database dialog but instead uses the email_address variable to look in the Airtable’s email column to find the user’s record. You will need to customise the same fields as in the Search order number in database dialog.

Flow: Returns

This flow allows your users to request to return an item they have ordered.

Dialog: Look up ordered items

After the user has given their name and email address, this Action dialog looks up the record in Airtable that matches their email address. Like in the Tracking flow you will need to customize this dialog by connecting it your own Airtable account and your own Airtable base.

Dialog: Select return item

This dialog shows the user the items they can return in a carousel. The names and images of the items are retrieved from the Airtable.
If you need to show your users more items to return you can add extra columns for items and links to their images in the Airtable and add more carousel items in the bot dialogue.

Flow: Feedback

With this flow users can give feedback on their experience using the bot. If the user indicates the bot was not able to help them the bot will ask what use case did not work for them and ask to describe in more detail exactly what went wrong.

Dialog: Feedback to Airtable

After the user has given their feedback, this Action dialog writes two variables, feedback and detailed_feedback, to Airtable.
In your Airtable base you will need a table with a column for each of the two variables.
In the Airtable account field, select your own Airtable account, or connect a new one if you do not have one yet. In the Base field replace the given ID with the ID of your own Airtable base. In the Table field replace the given ID with the ID or name of the table in your own Airtable base where you want to store the feedback data. If your own Airtable uses different column names you will also need to replace feedback and detailed_feedback in the Record field by the column names in your own Airtable.

Flow: Store locator

With this flow, your users can find which of your business’ retail stores is closest to them. The functionality of this flow is the same as the Find nearest location template. To find out how to customise this flow, you can consult the tutorial for that template here.

Flow: Post office locator

From the Prepare return dialog in the Returns flow, the user can navigate to this flow. Like the Store locator flow, this flow works in the same way as the Find nearest location template. To find out how to customise this flow, you can consult the tutorial for that template here.
Last modified 2mo ago
Copy link
On this page
Template overview
How to customise this template
Flow: General
Flow: Tracking
Flow: Returns
Flow: Feedback
Flow: Store locator
Flow: Post office locator