In this series of blog posts, I’m going through the steps to integrate Dynamics 365 Portals and Dynamics 365 for Customer Insights. The use case is that we want to see which knowledge base articles pages were viewed, and which searches were performed on the portal before a customer submitted a case. In the final post of the series, I’ll go through the steps necessary to surface the DCI timeline visualization on the Case form in Dynamics 365.
You can create rich visuals to present your DCI data; this is done via the Customer Insights application, a link to which can be found on your Customer Insights Overview in the Azure Portal.
In our case, we are wanting to create a timeline view of all of the interactions for a particular contact. To do this, we first create a Profile Instance View for Contacts. We can then create a Timeline Widget, and add the interactions we want.
At this point, if everything is configured properly, and you’ve actually done some of the interactions on your portal (ie. performed a search, view a knowledge article), then you should see a timeline of those interactions.
The next step is embedding the timeline on the Case form in Dynamics 365.
Embedding the timeline is pretty straight-forward; Microsoft provides documentation here on how to do it. All you really need to do is create a web resource and include it on the form of the entity.
However, our situation is just slightly different. In the Microsoft example, they wanted to show the Contact timeline on the Contact form. In our situation, we want to show the Contact timeline on the Case form (based on the customer attached to the case).
So I made a few tweaks for our situation:
if(window.parent.Xrm.Page.data.entity.getEntityName() == 'incident') { var attr = 'customerid'; if (window.parent.Xrm.Page.getAttribute(attr).getValue() && window.parent.Xrm.Page.getAttribute(attr).getValue()[0] && window.parent.Xrm.Page.getAttribute(attr).getValue()[0].id) { crmEntityName = 'crmrecordid'; crmEntityId = window.parent.Xrm.Page.getAttribute(attr).getValue()[0].id; } }This code was added right after the following line:
var crmEntityId = window.parent.Xrm.Page.data.entity.getId();
<iframe id="frameDCIView" src='' width="100%" height="450px"></iframe>
var dciViewUrl = "https://.apps.azurecustomerinsights.com/c360/#/view?viewid= ";
You can download the full source code for my web resource here.
After embedding the web resource on the Case form, we get the following results:
In this series, we went through the process of setting up a DCI resource in Azure, integrating it with Dynamics 365 Portals, and displaying a timeline of interactions on a Dynamics 365 form. Now, when users interact with our portal in certain ways (searching, viewing knowledge articles, viewing a blog post, or a forum thread), these events will be record in DCI and can be surfaced in Dynamics 365. This provides support staff with valuable information to assist them in resolving cases as quickly and efficiently as possible.
Excellent blog on dynamics customer Insights, Please keep sharing.