*** NOTE: ALL INFORMATION IS ACCURATE AT DATE OF PUBLISHING ***
While recently working on a post for generating emails for Microsoft Bookings and putting together an ICS file, I thought about what a fiddle it is (polite phrase) add an ICS file to your Google calendar. I had also recently booked a couple of restaurants online and noticed one of them had a specific Add To Google option in the auto responder email. Wondering how that could be done in Customer Insights – Journeys, I chuckled when I realised how easy it could be. Basically, a URL has a bunch of values passed through as parameters which are then mapped in to fields on a new calendar event in Google. If you want to give it a try, take a look at one way to include an Add To Google Calendar button on your emails.
Although you could build out the URL dynamically for each email, it’s probably better using a trigger. Or you could have a flow that runs each time an event or appointment of some kind is created in your D365 environment and build out the URL then. Either way depends on your patience and requirements. For this, I am going to built on the Microsoft Bookings post (last one I did before this one) and update the trigger to include a Google Calendar Link.
I am then going to add it in to an email by passing it through to a button dynamically.
I have mapped it to the Google Calendar Link value from the Microsoft Bookings Process With Google trigger. All simple so far. Make your email live and you can add it to a Journey ready to go.
In Power Automate, you will likely be wanting to do other things in the flow, so I am just going to focus on the steps needed to generate the full URL. This is what it looks like in my initialise variable step (can also use a Compose step if you want).
The generated URL will end up looking something like this. It’s made up of a series of parameters that I will walk through. Don’t just copy and paste as they include examples. You just need the parameter and then dynamically pass through the correct value in your flow.
https://calendar.google.com/calendar/event?action=TEMPLATE&text=Initial Requirements Discussion&location=Microsoft%20Teams&dates=20250414T080000Z%2F20250414T090000Z&ctz=Europe/London&details=Thank you for booking a meeting.<br><br> I am looking forward to our call. Below are the details you will need:<br><br>Service: Initial Requirements Discussion<br> Consultant: Megan V. Walker<br><br>Microsoft Teams Link:<br>https%3A%2F%2Fteams.microsoft.com%2Fl%2Fmeetup-join%2F19%253ameeting_ZDMwNDlkZmYtNTc1MC00YTRmLTg5ODktZWM3M2UxMTIxMjFm%2540thread.v2%2F0%3Fcontext%3D%257b%2522Tid%2522%253a%2522aa6d0e29-a01e-4d3e-94f4-b8ff512e97db%2522%252c%2522Oid%2522%253a%2522013993d4-be62-4031-8267-75ea1efef579%2522%257d%26webjoin%3Dtrue%26unified%3Dtrue
The first part should always look like this:
https://calendar.google.com/calendar/event?action=TEMPLATE
Now I am going to use the text parameter to add the subject or title of the event that will be added to your Google calendar. So for my title I am using a Service Name value passed through when a Microsoft Booking is made. Yours might be the subject from an Appointment or the name of an Event.
&text=Initial Requirements Discussion
Next we can add in the location. For my example, the events are online so I am just adding Microsoft Teams, but you can pass through an address for this parameter which will go in to the location field on the calendar event.
&location=Microsoft%20Teams
Now the dates with start and end times included. They need to be in the format of yyyyMMddTHHmmss followed by a Z. This time format is known as ISO 8601 in its extended basic format with UTC time notation. In between the two values, include %2F which is an encoded representation of the forward slash, then the end time with a Z.
&dates=20250414T080000Z%2F20250414T090000Z
This one is a bit of a pain, the timezone. Dataverse uses Windows timezone, and Google Calendar uses something called IANA. So in Windows it might be GMT Standard Time, but in IANA it would be Europe/London. Short of hard coding a bunch of them, hopefully you just work in one timezone so can set it in to the link like this. If not, and it’s important, you can do some mapping with a Switch condition or some expressions (good luck!).
&ctz=Europe/London
Finally, we need to details portion which would go in to the description of the Google Calendar event. It will understand some basic HTML so I have used <br> for some line breaks. If you are trying to include hyperlinks, you will need to wrap that around uriComponent so that it doesn’t mess things up, like this:
uriComponent(triggerOutputs()?['body/JoinWebURL'])
&details=Thank you for booking a meeting.<br><br> I am looking forward to our call. Below are the details you will need:<br><br>Service: Initial Requirements Discussion<br> Consultant: Megan V. Walker<br><br>Microsoft Teams Link:<br>https%3A%2F%2Fteams.microsoft.com%2Fl%2Fmeetup-join%2F19%253ameeting_ZDMwNDlkZmYtNTc1MC00YTRmLTg5ODktZWM3M2UxMTIxMjFm%2540thread.v2%2F0%3Fcontext%3D%257b%2522Tid%2522%253a%2522aa6d0e29-a01e-4d3e-94f4-b8ff512e97db%2522%252c%2522Oid%2522%253a%2522013993d4-be62-4031-8267-75ea1efef579%2522%257d%26webjoin%3Dtrue%26unified%3Dtrue
Once the link has been generated, we can then pass it through to the custom trigger by using the variable we created.
Now when the trigger fires and the person goes on the Journey, their email will have a lovely Add To Google button.
And clicking on the button will take them directly to Google so they can just save to their calendar. Hooray!
Check out the latest post:
Making the Move from Outbound to Realtime Marketing - Q&A Sessions 3 & 4
This is just 1 of 502 articles. You can browse through all of them by going to the main blog page, or navigate through different categories to find more content you are interested in. You can also subscribe and get new blog posts emailed to you directly.