Copy Appointments from Microsoft Bookings to Dataverse or Dynamics

If you or your organization uses Microsoft Bookings and would like to sync events from Microsoft Bookings to Dynamics or Dataverse or to any other calendar, then this blog post is for you. 👉

A while ago, I had a use case with a client where they were using Bookings to let their customers book a time-slot for a 1:1 feedback session as a part of annual customer survey. That time, there wasn’t a straight-forward way to sync events and also the Bookings API was in beta. Now, with the new Bookings connector in Power Automate, it should make things much easier.

P.S: Most of the use cases in my blog will now be based on The Office TV series, so apologies if you haven’t watched it. It’s a great show, so go watch it. 🙂

Dunder Mifflin, a paper company, just finished their annual customer survey and Kelly, their customer service manager has setup a Bookings page for their customers to book a 1 hour 1:1 feedback session with their sales rep or the manager. Now, Michael Scott has asked Kelly to manually enter each of the appointments into their CRM.

https://media2.giphy.com/media/gXRfDlf2OuvPfyNSzR/giphy.gif?cid=aafa0b4bhx9h1ma52wfrtw773q4k9xphc4zlc9ihy1i68qa9&rid=giphy.gif&ct=g

If you aren’t sure if you have access to Bookings, you can check here if your Microsoft 365 / Office 365 license includes it. If you haven’t setup a Bookings page before, here is a quick overview of the page that Kelly setup for their customers to book appointments.

/uploads/2022/07/2022-07-22_14-22-53-1-1.gif

The Bookings connector got added to the roadmap in March 2022 and was released as Preview in July. Check out the documentation reference for the connector here.

As of July 23rd 2022, the connector only has three triggers and no actions. The three triggers are :

As there are no actions, this means you can’t make changes to any of the appointments in Bookings, however, you can take the appointments from bookings and copy it any other system / database like creating appointments in Dataverse, create a Zoom meeting or request payment for the service through Paypal/Stripe.

Kelly reached out to her “colleague” Ryan about helping her with entering these appointments in CRM and he instead recommended using Power Automate to create the appointments automatically.

The flow steps will be -

  1. Trigger: When a new appointment is created in Bookings
  2. Action 1: Find the employee and contact record in Dataverse from the email address
  3. Action 2: Create a new Appointment with details from the Bookings Appointment

/uploads/2022/07/image-1024x440.png

A screenshot of the flow

For the Bookings trigger, you will require the SMTP address of your Bookings page. To find this, just open your Bookings page and copy the email like address from the URL. In the below example, the SMTP address would be [email protected] .

/uploads/2022/07/image-1-1024x66.png

/uploads/2022/07/image-2-1024x192.png

A screenshot of the bookings trigger

Then we find the User record and the Contact record from the email addresses we get from the Bookings appointment details. These record GUIDs are required for the action to create the appointment.

The employee email is returned as a part of the StaffMembers array. Currently, Bookings only allows booking an appointment with one staff member, however, in the future there will be an option to select a group and thus having multiple staff members. In this flow, we will limit to just getting one staff member, however, the flow can be easily modified for multiple staff members.

To retrieve the employee record, we use this filter query :

internalemailaddress eq 'triggerOutputs()?['body/StaffMembers'][0]['EmailAddress']'

/uploads/2022/07/Screen-Shot-2022-07-23-at-1.24.38-PM-1024x706.png

A screenshot of the find employee record action

To retrieve the contact record, we will use this filter query:

`emailaddress1 eq 'triggerOutputs()?['body/CustomerEmail']'`

/uploads/2022/07/image-3-1024x707.png

Next, we will use the GUIDs from the first record returned in the above two actions and set them as variable values.

/uploads/2022/07/image-4-1024x290.png

/uploads/2022/07/image-6-1024x298.png

Now, for the finale, we will create the Appointment using the Dataverse action to Create a new row.

Let’s look at the first part of the action:

  • Copy the Start Time and End Time from the Bookings appointment. For the Subject, you can get creative and compose it the way you prefer. In this example, we take the Service Name and combine that with the Customer Name. For the Description, use the Service Notes and insert the Bookings Meeting Unique Id, which you could then use to retrieve the Appointment in Dataverse if there is a change / cancellation of the Bookings Appointment. If you want the meeting to show up as a Teams meeting, make sure to select Yes for the “Is Online Meeting” column.

/uploads/2022/07/image-7-1024x671.png

A screenshot of the Add Appointment action - Part 1

  • Next, let’s define the organizer and the attendees which in the Dynamics/Dataverse world are known as Activity parties.

/uploads/2022/07/image-8.png

  • Lastly, for the meeting to show up as a Teams meeting with the meeting link in Dataverse, we have to add a few more column values.

/uploads/2022/07/image-9.png

And now you are ready to test the flow. Below is an example of an appointment example that Tom from Blue Cross set up with his sales rep Jim Halpert.

/uploads/2022/07/image-10-1024x634.png

A screenshot of the Bookings appointment

/uploads/2022/07/image-11-1024x427.png

A screenshot of the appointment created in the CRM

And this is how Kelly saved herself a bunch of time by automating creating appointments in CRM instead of manually adding them. She is going to wisely use this saved time to prep for the fashion show.

https://media0.giphy.com/media/oNHXVaotvMqQM/giphy.gif?cid=aafa0b4bz9lytvsh9cps5osm1cq0e9uczx9fchd4lcd2vylf&rid=giphy.gif&ct=g

Though we covered only creating events, ideally you would want to update and cancel them as well using the other two triggers in two additional flows.

What other use cases do you have with the Bookings connector? Let me know in the comments.

Did this article help you❓

Subscribe to get more Power Platform articles directly in your inbox