Personalized Community is here!
Quickly customize your community to find the content you seek.
‘Better Together’ Integration forum available
We're launching a how-to forum where you can learn and engage about how Dynamics 365 integrates with other Power Platform products.
Read about Better Together forum
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
Power Virtual Agent is a great piece of software, it makes a lot of people's dream (like mine) to create their own chatbot, real.
With this example, I want to share with you how you can use PVA (Power Virtual Agent) to create cases in your Dynamics 365 instance.
This can be either an external chatbot or an internal one, in any case, it is quite useful.
Let's get started
First of All, you need to create a virtual bot, if you don't have, one you can sign up for a 30 days trial for Power Virtual Agent.
Make sure you sign up for a trial on your existing Dynamics CRM instance.
Follow this article on how to Sign up for a trial.
Once you have a trial up and running, you need to create a new bot Topic.
The topics are usually the starting point of a chatbot. They specify the sentences that will trigger the bot, in our case, such sentences can be:
Then you need to configure the chatbot logic.
For now, we will keep it quite simple by asking just four questions that request basic user information to create a case.
For all four of them the settings are as follow:
Ask a Question - contains your bot's question
Identify - User's entire responses
Save response as - give a name for the object (Customer Name)
Each Question that requires input from the customer will need to save this input as an object that we will use later in CRM
Here are my examples:
Repeat the steps above for all the other three questions.
Next, we need to trigger an action that will create the case in Dynamics CRM, using the provided information.
Let's open Power Automate and create a new Workflow.
Before that, it is very important to mention that the Workflow must be in a separate solution in order to work.
Create a new Solution and make sure you are in the right instance!
The Workflow is quite simple but yep will require some JSON knowledge and APIs.
I will post the code here for the purpose of this article.
Let's take a look at this this is the hardest part.
The organization will be our main one
Entity Name is Contact
Last Name - will be the CustomerName property.
If we are asking him to provide First and Last name then you will have both as a separate property received.
Email is the CustomerEmail property from the bot.
So far, we used half of the provided information. Now for the other half we need to create a case as it is related to a case.
Organization will be our main one
Entity Name this time is Case
Case Title will be the received Property called CaseTitle
Customer is a Contact (the one created from the previous step)
Customer Type make sure it is set to Contact
Description is the CaseDescription property
The last Step of the Workflow is to inform back the customer that a case was created, so we need to return the Case Number of the newly created case.
This time we need to select a Response option (since we are returning a response to the Power Virtual Agent
The response code is quite simple:
"CaseNumber": "CaseNumber option from the Create Case step"
We can save the Workflow and Proceed to the last setup.
Return back to the bot settings. After the last question, add a new step called Call an Action, and the Workflow that you've created will appear here, so just select it.
Note: if you don't see your WF, it means that is not created in a separate solution, or the solution that you've created is in a different instance.
Add all the inputs from the customer's conversation in the bot.
To complete your bot, add the final step for output, which will return to the customer the case number.
Let's see how it looks in action.
This how the case looks in Dynamics CRM
You can develop this by requesting more information from the customer, checking case status and etc.
Feel free to share with me any suggestions on how to improve this bot, for future articles to help others.
Business Applications communities