Can I create a personalized journey with information about the current weather in Dynamics 365 Customer Insights?
In May this year, I was in Istanbul with my mom and the weather has not been so cooperative. It rained for almost 4 days and I was really sad because I was looking forward to the rooftop bars overlooking the Bosphorus. Then one day I got a newsletter from the booking portal where I had booked the trip and it really surprised me. In the subject line it said The little drizzle in Istanbul can’t stop you and in the content Perfect experiences for rainy weather with a range of activities. Now that’s what I call personalized email marketing!
Then at an event last week, someone showed the way to display the current weather in Power Pages and I thought, this must work for Customer Insights too! And ta-da, it sure does!
Weather related marketing
I would like to show two variations on how to implement a personalized journey in conjunction with weather in Customer Insights.
- Segment-based: Send a newsletter to a distribution list, but the content should be different depending on the current weather conditions at the contact’s location.
- Trigger-based: When the weather changes, all affected contacts should receive a push notification.
Variation 1: Segment-based Journey
The journey consists of the start segment, a custom trigger that retrieves the current weather, a waiting period, and the marketing email that I personalize.
Before I create the trigger, I previously create a Recent Weather Condition field on the contact that will store the weather condition. It’s enough if it’s a simple text field and it doesn’t necessarily need to be displayed on the form. After that, I start with the trigger and the PowerAutomate flow that is supposed to retrieve the weather of my newsletter recipients.
The trigger itself is not complex at all and doesn’t need to contain any attributes. Activate the trigger so you can find it in PowerAutomate.
Create a PowerAutomate Cloud Flow
In the flow I start with Perform a bound action and select my previously created trigger. Select CXP as catalog and Custom as category. Then in the Action Name you will find your custom trigger.
In the next step I retrieve the contact that runs through the journey. The contact ID is given by the trigger in the field msdynmkt_profileid.
The third step retrieves the weather at the contact’s location. For this I use the MSN Weather function, which is available by default with PowerAutomate. There are of course other APIs that can be used for this, but for demonstration purposes the MSN Weather connector is absolutely sufficient. I enter the city field of the contact to get the weather from there. Of course, you can also get the zip code, the country or longitude and latitude. Then I update the contact with the current weather condition. This I write into the new field I created at the beginning. And this can be overwritten with every run of the journey, the weather changes, too, after all.
Create a personalized email
After that I create the e-mail where I dynamically replace the texts and images based on the value from the Recent Weather Condition field. I’m a big fan of the personalization feature in e-mails and think it should be used much more often. Now’s your chance:
To do this, select the block you want to personalize. In the section you will find the little person icon and then the color of the border around the section will change from blue to purple. There you can set the condition and add the right images and texts. I add a second condition so that I have a block for sunny days and a block for rainy days.
At the end, I put all the elements together in the journey. After the custom trigger that retrieves the weather, I set a waiting period, simply to give the PowerAutomate the opportunity to run through. The duration can vary depending on the size of the distribution.
And with this, variation 1 is ready to create a personalized journey with the weather in Customer Insights.
Variation 2: Triggerbased Journey
Of course, this journey starts with a trigger. This is the first thing I create. In this case I add an attribute to the trigger that stores the weather condition so that I can use it as a condition in the attributes of the journey later.
I start the flow with the MSN Weather Trigger When the current conditions change. There I can also choose a specific location, in my case Hamburg. Here it is also possible to enter the postal code, the country or longitude and latitude.
In the next step we query all contacts in Hamburg, so that only these contacts with the weather change are notified.
In the last step, I choose Perform unbound action to trigger my marketing trigger. You can find your trigger in the action name by typing msdynmkt_ and your trigger name. The action will then display the variables. I add the weather condition from the MSN trigger under msdynmkt_weathercondition. In the fields msdynmkt_signalingestiontimestamp and msdynmkt_signaltimestamp I enter the modification date of the trigger. For msdynmkt_signaluserauthid and msdynmkt_profileid, it is important to add the contact or contact ID of the identified contact from the previous step. This then creates the Apply for each-loop that starts the trigger and thus the journey for each contact in Hamburg.
I now start my Journey with the trigger and add an attribute branch that sends the contact either a push notification when it’s sunny or another push notification when it’s raining.
In contrast to variant 1, we can not only create the condition on the basis of fields on the contact, but also use the attributes from the trigger. Since we write the weather condition into the variable of the trigger in our PowerAutomate, we can use it for the branch at this exact point.
I define two branches: One for sunny days and one for rainy and cloudy days:
With this article I would like to inspire you a bit to think outside the box. Certainly, the PowerAutomates can be built more performantly or more sensibly. But the variants open up great new possibilities in Customer Insights for a personalized journey that is related to the weather.
However, I would like to mention a few points:
In my flows I use the current weather. Of course, it is also possible to look into the future and retrieve the weather forecast. I can also think of many good use cases for campaigns.
The MSN Weather connector
The MSN Weather connector gives various weather data, like the temperature, wind speed, UV index and many, many more. I use the weather conditions and there are some values that are output as text. So far I could find the following values, which store the conditions in the emails and Journeys: sunny, partly sunny, mostly cloudy, cloudy, partly cloudy, fog, clear, rainy. But I bet there are some more and will keep an eye on this to complete the list.
The When the current conditions change trigger really starts every time the conditions change. This can be several times a day. Please be sure to keep this in mind for your journey, we don’t want to spam contacts. For push notifications then using frequency per day could be exciting. Another idea is to use a Scheduled Flow that only runs once a day and polls for weather. This definitely reduces the number of times the flows run and thus saves on costs.
I’m excited to see what you do on this and look forward to feedback!
References: MSN Weather – Connectors | Microsoft Learn
***Please be aware: The content is accurate at the time of creation. It may be that Microsoft has made changes in the meantime.***
Check out the FAQ section of my blog as well: Short questions with quick answers! Go to FAQs