How to Set the Date Mappings from Facebook Lead Ads to Dynamics 365 using Zapier

Miguel Nepomuceno, 27 September 2017

Zapier is a service that allows for integrations and task automations across multiple web applications. In my previous blog posts, I went over setting up the Facebook Lead Ad Trigger and the Microsoft Dynamics 365 Action in your Zaps. This blog post will go over configuring the Birthdate field mappings in Zapier for the Microsoft Dynamics 365 Action step.

The most common fields that are retrieved in Facebook Lead Ad Forms are covered. These are: Full Name, Email, Phone Number and Birthdate. Email and Phone Number are simple with direct mapping, where we can just select them in our Zapier dropdown. Birthdate was a little tricky based on my experience configuring the mapping through trial and error. When I initially attempted direct value mapping of the Facebook ‘Date of Birth’ to ‘Birthdate’ in Dynamics 365, I got the following error:

image

The initial attempts to solving this problem is with the suspicion that the date being passed in CRM is in an incorrect format. Facebook passes the dates from Date of Birth in the format MM/DD/YYYY (using Zapier date format notation). What ended up working for me is testing the mapping by passing in the Created Time value from the Facebook Lead Ad into the Dynamics 365 Birthdate field. The values that are passed from Facebook need a Time and Time Offset value for UTC standard (screenshot below).

image

With this knowledge, we can simply use the Zapier Formatter to convert the value coming in Facebook Lead Date of Birth MM/DD/YYYY to the format YYYY-MM-DD.

image

Then, in the Microsoft Dynamics CRM Action, we can concatenate time and time zone values from our reformatted Date. In the CRM field Birthdate, we concatenate the ‘T’ notation (indicates time), the Time in HH:mm:SS format, and the ‘Z’ token (indicates time zone). The Z token in Zapier returns a time zone output. In this case, it will give the default output for the Z token, which is +0000.

image