Extending Dynamics 365 with Bots: “Ok Google, what’s next for me”

In our last post, we discussed the endless possibilities of Bots and Dynamics 365. We saw that how you can easily integrate the Azure Bot Service with CRM using S2S authentication and extend the features depending upon your business use case. I also specifically mentioned there that Power Platform will be touched at later stages but now I think it’s the right time to discuss this rich platform.

The Power Platform is a platform comprised of 3 main components, Power BI, Power Apps and Flow. They allow you to customize, extend, build and unlock the potential of Dynamics 365 faster than you ever thought possible. You can always look for their details here.

In this post, we will discuss how you can leverage of power of Microsoft Flow along side Bot Framework (Azure Bot Service) and extend the operations of Dynamics 365 to serve your customers better in a productive way.

Microsoft Flow is a service that allows you to create different kind of automated workflows between your apps (even your favorite ones) and services to work together, collect data to do more and work less.

Broadly, there 4 types of flows – automated, scheduled, button and business process flows. As per our current business requirement, I will only be touching automated flows and will try to cover up the rest of the flow types in my later posts.

Retail Bank – Customer Service & Delivery

Let’s assume we work for a bank called Cognitive Bank (yes, that’s the name we will be using for our future posts if it gets related to banks) who on-boards its customers on the fly, without the need of visiting any branch.

In case you want to see how you can register your prospect customer, you can have a look at my last post.

Now, since the customer KYC process is completed (account creation is done) and a CRM case has been created for the staff as bank wants to send customer his debit card through Customer Services & Delivery department.

So now, in order to achieve the above goal, we are going to use Microsoft Flow to bridge (and power) our connection between Dynamics 365 and bank’s Digital Assistant aka Cognitive Bank Bot. Therefore, we are creating a custom flow from the scratch which works in this manner;

Extend Dynamics 365 with Bots using Flow

Our bot which is powered by Google Adapter of Bot Builder Community sends a HTTP request to the flow.

Cognitive Bank

Flow takes the UserID of the staff (who is already logged in to the bot) from the HTTP request and get the latest case assigned to her.

Http Request Microsoft Flow

From that case, Customer’s ID is fetched and his required details such as Name, Address and Mobile Number are set/appended to a string variable in flow.

Case Retrieval from Dynamics 365

Lastly, that string variable containing all the customer information is sent through HTTP Response back to the bot to display that information on the card.

Note: For the sake of simplicity, we assume that our bot is already aware of the user (bank staff) who is using it, therefore, no authentication is required in this case. Currently, I’m having some issues with action buttons therefore I was not able to write a code to Navigate using Google Maps. However, I will try to update the code later on.

This is one of the useful scenarios which can help businesses improve their customer services operations. There can be several others of similar nature where you can create other Flows to automate your processes.

In case you want to contribute/enhance this process or just want to have a look at a sample to get an idea of implementation, I have uploaded the source code on my GitHub repo. Happy coding!

Until next time.

Related Posts