How to set up appointment scheduling in Google Calendar using Flow Builder
Last updated
Last updated
In this guide, you will learn how to use the Recognize Intent, Recognize Entities, and Create Google Calendar Event steps in Flow Builder to automatically schedule customer appointments in Google Calendar.
A WhatsApp for Business account, or any other channel from MessageBird's offering
A Google Calendar Account
An existing flow in Flow Builder to handle the messages or the following pre-made Appointment Bot JSON file, if you’d prefer to start with a pre-made flow
The flow we are going to build will consist of roughly three parts.
The first part will decide what the intent of the user is. This will be done using the Recognize Intent step.
If the user intends to book an appointment, then the second part of the setup will be to ask the customer to provide their preferred appointment date and time. This date and time will then be extracted by the Recognize Entities step.
Once the time of the appointment has been collected, the third step will be to use the Create Google Calendar Event step to schedule the meeting in your Google Calendar and confirm this to the user.
For this guide, we’re going to create a new custom flow with an Omni-channel trigger.
If you’re new to Flow Builder, or if you want an easy way to set up appointment scheduling, download our pre-made Appointment Bot flow.
Log in to your MessageBird Dashboard and go to Flow Builder
Click Create new Flow and select Create Custom Flow from the options that appear (or click on Import Flow, and upload the pre-made Appointment Bot flow)
Follow the Intent Recognition - Quickstart guide to create a dataset and intent recognition step. The dataset needs to include two intents: “appointment” and “question”. Download the example CSV here, or take a look at the sample dataset at the end of this guide
Done? Awesome! Now, set up branching between the intents. This guide will only cover the “appointment” intent, but if you want to set up the “question” intent branch, read our guide to Building an omnichannel FAQ BOT with Intent Recognition
In the “appointment” branch, add the Reply to message step, and set the message reply to “When do you want to book the appointment?”
Add a Wait for a response step, and name the output variable of the response appointment_time_message
Add a Recognize Entities step and set the ‘Content to recognize’ to appointment_time_message
Select your desired Time Zone from the dropdown list. Selecting your time zone makes sure that the extracted time is correct and uniform. Configure the step to recognize time by clicking Add entity and setting the entity to time. Use the variable name appointment_time here, then save both the entity and the step. Now that it’s set up, this Recognize entities step will extract the user’s appointment time preference from the message, and convert it into a standardized time value, which will allow us to create a calendar event later in the setup
Try the Recognize entities step yourself by using the demo page
Now, we want to confirm with the user that we collected their appointment time preference. Add a branch step and create an “else” branch for appointment_time is empty or not set. This branch will handle messages where the user did not give a preferred appointment time, so we’ll set it up to ask the user to provide this information
Add the Reply to channel message step, and set the message reply to “We’re sorry, we couldn’t understand your request. When do you want to book the appointment?”
Add a Jump to step and select the Wait for a response step that we created in step 6
Next, return to the “else” branch of the branching step that you created in step 10
Add a Create Google Calendar Event step. Make sure you have connected your Google account in the integrations tab. Select your account and calendar in the step settings
For the Event Title, use both the contact.firstName and contact.lastName variables to create an event named for the current contact. In the Start of Event field, use the appointment_time.normalized variable, which will ensure the date is correctly interpreted
Add your own email address to the Guests/Participants field, and save the step
Add a Reply to channel message step, and set the message reply to “Great, your appointment is confirmed!”, then save the step
Publish your flow by clicking Publish in the top-right corner of your screen, and you're good to go!
Time is not the only entity that can be recognized by the Recognize Entities step. Other uses could be to extract the number of guests the appointment is for, or recognize the place where the appointment takes place, or even to create and recognize your own custom entities via the Knowledge Base tab.
Google calendar not the calendar of your choice? With the HTTP Request, you can connect to any calendar service that exposes an API, or even your own backend.