Recently I got a chance to explore this while doing a small POC for one of my customers. And boy! I liked it. All this time I was hearing about this and also watched the MSDN video. But nothing is true experience until you get a first hand experience of it.
Here was the scenario for our customer. The customer has a social engagement portal which tracks the posts in the social engagement channels (like Facebook, Twitter, Linkedin etc) and feeds the JSON response to an activity in the form of JSON response. From the JSON response, we had to create a contact. So we had two options here.
- Parse the JSON response and write some interface that would create the contact in CRM after parsing the JSON from the portal. This can be achieved by using SDK and JSON parsers like Newtonsoft.json.dll.
- Use the ‘Automatic record creation and update rules’ feature that comes along with Dynamics CRM 2015 Online update 1
If something is present OOB, why re-invent the wheel. And also with configurations the advantage is the maintainability since you can get away with the engagement of a developer for any kind of changes/ fixes in the code.
First of all, I created a custom activity of called – ‘Social Engagement Activity’. To identify the channel from where the activity is created, I created a custom field ‘Activity Channel’ to determine the social channel from which the activity is created.
The following is the json output from the social portal. Off-course we have lot more values. However for an example I am presenting a simplified version of the json we are getting.
{
FirstName: “Debajit”,
LastName: “Dutta”,
Email: debajit.prod@gmail.com
}
- Now go to Settings –> Service Management –> Automatic Record Creation and Update Rules.
- Create a Record Creation Rule.
- Enter the basic information for the rule
- This is extremely interesting. Now create a new channel property. These are the properties that will be mapped to the JSON properties that I specified earlier in the Activity Additional Parameters’ field.
- Create the Channel Property corresponding to each property of the JSON output. Remember the property names are case sensitive. Since my JSON input contained three parameters FirstName, LastName and Email, I have created the same three channel properties below.
- Now the next step is to specify the rules for record creation. Go to the rules creation section and click to create a new rule.
-
You can specify the conditions but in my case no condition was needed. Now comes the important part. When we set the properties of the contact, in the form assistant you will see the channel properties you created. So I map the contact fields with value from the channel properties.
-
Now we need to activate the rule. And you are done with the settings.
- Now I go ahead and create a new ‘Social Engagement Activity’ record. with the values specified below.
- And voila, the contact record is created. Isn’t it great!
I have just given a simple example here but I guess with the features provided you can leverage it to build complex functionalities.
Hope this helps!
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.
I followed the instructions here I can successfully create a record if I have the role of System Administrator if I have other security roles I cannot. What security roles are need in order to successfully use the channel properties?
Are you getting an error? OR is the contact record simply not getting created? Let me know. The key here is creation of the social activity record and permissions related to that.
Also one more point here. Things have changed a bit from CRM 2015 Online Update 1 to CRM 2016. In CRM 2016 you no longer can create a social activity through UI. It has to be done through code. Also it necessitates the creation of a social profile record as well. I have written a latest post on the same – https://debajmecrm.com/2016/04/19/integrate-social-channels-other-than-facebook-and-twitter-to-automatically-create-record-in-dynamics-crm/
In addition to my previous comment, to check the error if any happening, you will need to go to settings -> system jobs to check for any errors.
Regards
Debajit
Hi – I have tried your example but using an email activity instead. Can you describe how I can get the JSON properties into the email if it is being sent from outside CRM?
Hi Mark,
Thanks for reading my blog. The implementation has changed a bit from 2015 Online update 1 to 2016. I have posted the same in my link – https://debajmecrm.com/2016/04/19/integrate-social-channels-other-than-facebook-and-twitter-to-automatically-create-record-in-dynamics-crm/
Now coming to your question, every activity including email has a field called ‘activityadditionalparams’. With record creation rules you can map the json of the email to a social activity and then you can follow the blog link that I shared. I hope that helps!