Take Christmas Lunch Bookings Through Messenger, Telegram or SMS

In this tutorial, we’ll be showing you how to take bookings via a bot. It’s quick and easy to build this handy bot that will be on hand to assist your customers 24/7. Feel free to install our Flow for this tutorial to get you going even faster!

Far too often we find ourselves going to a different restaurant or venue because we didn’t manage to make time in our busy schedule to book a table in time.

How great would it be if you could just go to your favourite messaging app and quickly book a table whenever you had just a moment to spare? That’s where bots come in. They’re on hand to help anytime, any day.

What you will learn

  • Collecting data using a bot
  • Searching a Google Sheet
  • Adding a row to a Google Sheet

Bots and Flows

Bots are bringing a whole new kind of automation to business services. From tasks as simple as providing a company’s opening times to tracking parcels, finding holiday deals, promotion campaigns and so much more, bots are proving to be an extremely useful asset for any B2C business.

Flow XO provides over 90 integration services alongside a variety of bot services making it possible to build bots for a wide range of use cases.

The logic is broken down into simple, logical steps that are contained within a flow. The flow starts with a trigger (what causes the flow to start) and it can contain as many tasks (actions to carry out) as you need it to. You can also add logical filtering to the individual tasks or trigger in the flow allowing you to decide whether an action should or shouldn’t be done based on specific data or the result of a previous task.

Building the Bot

All that you need to get started is a bot, Google sheets and a Flow XO account, all of which are free to start using!

We’ll be using Google Sheets to search for available dates and to store the details of any bookings that the bot takes.

Complete Flow

We’ve used the new conversation trigger for this flow, which triggers the flow as soon as the user presses ‘Start’ (Telegram) or ‘Get Started’ (Messenger) to start the bot. The flow will also be triggered if the user greets the bot with Hello or common variations such as Hi.

Tip: If you want to use a keyword to trigger the bot you can use the bot — New Message trigger, which you can show as a shortcut. Shortcuts are given as on-screen buttons if supported.

As soon as the conversation has been started, we use the ‘Ask a Question’ action, found under the bot service, to ask the user if they would like to see the Christmas menu. We’ve used the choice type question so that we can provide the user with handy on-screen buttons for them to make a selection.

First Question
Tip: We’ve started by greeting the user and added the User Name output in to the question text to make it more friendly.

The next task in the flow is the ‘Send a Card Set’ action, which allows you to send up to 3 cards. These can contain a title, image URL, text, link text and link URL.

Send a Card Set Settings

Messenger does something cool with card sets and displays them as a carousel. Depending on the device screen size, one or two cards will be visible. The user is able to freely move backwards and forwards through the cards, which slide from the side.

Messenger Card Set

Sadly, Messenger is currently the only app that offers this carousel feature. Other apps, like Telegram, will show each card as an individual message.

Telegram Card Set 3/3

We’ve also added a filter to the card set to check that the user answered ‘Yes please’ to the question asking if they would like to see the Christmas menu. If the user answers ‘No thanks’ the task will be skipped.

Filter on Send a Card Set

Next, we ask another question. We ask the user if they would like to book a table. Giving the options of ‘Yes please’ or ‘No thanks’. This task is following by a Bot — Send Message task. It’s a simple message to say goodbye to the user.

Send a Message Task

We’ve added a filter to this task so that the message is only sent if the user answered ‘No thanks’. We’ve ticked the ‘Also stop rest of flow if conditions are met’ so that no other actions in the flow will be run if the user does not want to book a table.

Send Message — Filter
Tip: Checking the box to prevent further actions from running allows you to end the flow without needing to filter out each subsequent action.

If we reach the next action in the flow, the user has confirmed that they would like to book a table so we need to find all the available dates. Our Google Sheet has been laid out with the available dates and the status of either ‘Available’ or ‘Fully Booked’.

Google Sheet — Available Dates

We search for ‘Available’ in the Status column of the sheet to find all the available dates.

Google Sheets-Search Settings

This will return all the rows that have ‘Available’ in the status column. We then use the output from the task to populate the buttons for the next task, which is a Bot — Ask a Question. Using the Collections Outputs we can select a row for each of the possible choices and we’ve used the Date cell of the specified row.

There is a maximum of 4 dates so we’ve added 4 choice options.

Question populated with available dates
Note: If any of the cells that we’ve referenced are empty or don’t exist, they will not be included when the user is presented with the question. Only the choice options that contain a value will be displayed.
Question with only available dates

Once the user has made a selection, we’ll add the booking details to our Google Sheet using the Add Row action. We’re adding the date selected, user’s name and we’ve also captured the response path.

The response path is the unique identifier for the conversation with the user. We can re-use this at a later stage to communicate with the user should we need to provide any updates/information regarding their booking.

Bookings Sheet
Tip: You could create another flow to add extra functionality to allow customers to cancel/amend bookings. If they are using the same device that the booking was made on, you can use the stored response path so that that they don’t need to provide a booking reference/details.

The last step in the flow is to confirm the user’s selection. This is done using a Bot — Send a Message task and we’ve included the user’s name along with the selected date as part of the confirmation.

What Else Could You Do?

What about when you offer a variety of seating arrangements? Perhaps you have some tables that seat 2 people, some that seat 4 and so on. Well, there are a couple of ways that this situation could be handled.

If you used a service that allowed for more advanced searching, such as the MySQL — Run a Query, you would be able to ask the user how many people would be attending and then query the database for the dates where a table that offers enough seats (2 seats, 4 seats etc) is available and only show those dates to the user.

Alternatively, you could take the results from a Google Sheet search into our Code service to check whether there are any suitable tables available and then output a new array containing only the dates that have the relevant tables available.

With both the Google Sheets and MySQL integrations, you have the option to update values so you can apply a limit for the number of available tables and update that value each time that a booking is taken as well.

If you are using either the Feed or Push service to provide promotional information to people you could ask the user at the end of the booking if they would like to subscribe for updates/offers and subscribe them to the feed or push service that you have.

What have we Accomplished

Using just a few services, we’ve built a bot that will be able to take bookings allowing you to focus on making each customer’s visit extra special. And now that you have a handy bot to take bookings, how about reminders? Why not take a look at our Never Miss a Booking tutorial.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.