Power Virtual Agent integration with Dynamic 365 CRM using Power Automate
In this article we are going to see how Power Virtual Agent, Power Automate and Dynamic 365 CRM combine to do wonders!
To demonstrate, I have taken a scenario of broadband Internet provider company extending their effective customer support using Virtual Agent Service.
I have captured few real times scenarios of the services provided by the internet provider company like:
When user starts the conversation with greeting phrase like Hi, Hello, Good Morning etc. Immediately virtual agent responds the user to select the below option:
New Internet Connection Process Branch:
Customer is requesting for new internet connection
Power Virtual Agent:
Step 1:
Virtual agent asks a details to the user like:
Virtual agent stores the user entered details in the variables (named as name, mobile, zipcode, email, streetaddress) to create a lead in Dynamic 365 CRM using power automate against user request.
Step 2:
Based on user entered details in virtual agent, we need to create lead record in Dynamic 365 CRM. For this I have created power automate named as lead creation flow to create lead record in the CRM.
To trigger lead creation flow from virtual agent, I have added call an action node where all created power automate is listed out.
Important:
If the above key points are followed, call an action node in virtual agent will list out all power automate name which is created in same environment.
Call an action node is added and select lead creation flow. Lead creation flow gets five inputs and gives one output. select and provide the appropriate variable (like Name, Email, StreetAddress, Mobile, Zipcode) for each of the inputs. Similarly, select the output variable from flow to send the response from flow to the user.
Base on the inputs, lead creation flow creates a lead record in the Dynamic 365 CRM.
Step 3:
On successful creation of lead in Dynamic 365 CRM, the output response from Lead creation flow is feed to the message node in the virtual agent and displayed to the user.
Step 4:
End with survey node is added to end the branch.
Power Automate: Lead creation flow
Step 1:
Power virtual agents action is used to trigger the flow from the virtual agent based on the user input like name, email, mobile number, etc.
Step 2:
CDS Create a new record action is used to create lead record by passing essential details like Name, email, mobile number etc.
Step 3:
Successful creation of lead records, greetings email has been sent to the user.
Step 4:
Return value to power virtual agent action as key “LeadCreationResp” and value “Thanks for choosing ABC Internet Provider. Our representative will contact you shortly.” that will be sent as an output to the virtual agent.
New Internet Connection Process in Action:
Customer will get the email notification:
Broadband related queries Branch:
Before offering service to customer, virtual agent prompts the user to enter mobile number to check whether user is existing customer or not.
User Authentication process:
Power Virtual Agent:
Step 1:
Ask a question node is added to display the message “As a process of authentication, I would require you to provide your 10 digit mobile number” to the user and ask them to enter it.
Step 2:
To check the entered mobile number is existing customer or not in the CRM system.
Call an action node is added and selected power automate named as Authentication flow. Authentication flow gets one inputs and gives two outputs. select and provide variable (PhoneNumber) as an input. Similarly, select the output variable from flow to send the response from flow to the user.
Based on the response from flow, the condition branch is further divided in to:
Power Automate: Authentication Flow
Step 1:
Power virtual agents action is used to trigger the flow from the virtual agent based on the user input.
Step 2:
CustomerID and EmailAddress Variables are initialized to store customer account record GUID and email.
Step 3:
CDS list records action is used find out customer account based on the applied filter by customer mobile number.
Step 4:
Check whether length of the record count is equal to 1.
Step 5:
Condition action is added to check the record counts. If record count is equal to 1 then CustomerID variable is set to customer account record GUID and EmailAddress variable is set to customer email id. Else if record count is not equal to 1 then the variable is set to “NotFound”.
The below expression is used to check the output of the list record length is equal to 1
length(outputs('List_records')? ['body/value'])
Step 6:
Return value to power virtual agent action send the customer account record GUID and email address value to be stored in variable in virtual agent action.
User Authentication Fail Branch:
Power Virtual Agent:
Step 1:
If user record is not found in the CRM systems.
Step 2:
“Oops! There is no such account registered with us. Kindly try again later” message is feed to Message node in the virtual agent and displayed to the user.
Step 3:
End with survey node to end the branch.
User Authentication Fail Branch in Action:
User Authentication Success Branch:
Power Virtual Agent:
Step 1:
Based on customer account record found in the CRM system. Virtual agent offers three type of service to customer.
Note:
From customer account records, we have stored account record GUID and email address in virtual bot to perform the above mention operation. For example, customer account record GUID is essential attribute to create a case against the customer in the CRM system. Once case record is created, using customer email address, email notification is sent to the customer.
User Authentication Success Branch in Action:
Internet not working Branch:
Power Virtual Agent:
If User has chosen an internet not working option.
Step 1:
Ask a question node is added to display the message “Enter the issue” to the user and ask them to enter it.
Step 2:
Call an action node is added and selected case creation flow. Case creation flow gets three inputs and gives one output. Select and provide the appropriate variable (like User ID, Email, and issue description) for each of the inputs. Similarly, select the output variable from flow to send the response from flow to the user.
Step 3:
On successful creation of case in Dynamic 365 CRM, the output response from Case creation flow is feed to the message node in the virtual agent and displayed to the user.
Step 4:
End with survey node is added to end the branch.
Power Automate: Case Creation flow
Step 1:
Power virtual agent action is used to trigger the flow from the virtual agent based on the user input.
Step 2:
CDS create a new record action to create case in CRM system based on the input parameters like issue description, user ID (case is created against user account).
By default, we have set few attribute values which is mentioned below:
Case Title: “Internet is not working”
Origin: “Virtual Bot”
Case Type: “Problem”
Step 3:
Send an email notification action is added to send email to user about case details like case ticket number etc.
Step 4:
Return value to power virtual agent action send the message to be displayed to the user as a response from the bot.
Internet not working Branch:
Customer get the email notification:
Account details Branch:
Power Virtual Agent:
Step 1:
If user selected Account details option in virtual agent. Account details branch processes follows
Step 2:
Call an action node is added and selected account details flow. Account details flow gets one inputs and gives one output. select and provide the User ID variable as an input. Similarly, select the output variable from flow to send the response from flow to the user.
Step 3:
The output response from Account details flow is feed to the message node in the virtual agent and displayed to the user.
Step 4:
End with survey node is added to end the branch.
Power Automate: Account Details flow:
Step 1:
Power virtual agents action is used to trigger the flow from the virtual agent based on the user input.
Step 2:
Initialize variable node is added to initialized and store Account details information in the variable.
Step 3:
CDS list records action is added to find out current purchased items (internet package) against customer.
Step 4:
Condition action is added to check the record counts. If record count is equal to 1 then accountdetails variable is set to current purchased item against user. Else if record count is not equal to 1 then accountdetails variable is set to "Sorry! No package active found. ".
Step 5:
Return value to power virtual agent action send the message to be displayed to the user as a response from the virtual agent.
Account details Branch:
Check service ticket status Branch:
Power Virtual Agent:
Step 1:
Ask a question node is added to display the message “Enter Ticket No” to the user and ask them to enter it.
Step 2:
Call an action node is added and select power automate Ticket flow. Ticket flow gets two inputs and gives one output. select and provide the appropriate variable (like Ticket Number and Email ID) for each of the inputs. Similarly, select the output variable from flow to send the response from flow to the user.
Step 3:
the output response from Ticket flow is feed to the message node in the virtual agent and displayed to the user.
Step 4:
End with survey node is added to end the branch.
Power Automate: Ticket flow
Step 1:
Power virtual agents action is used to trigger the flow from the virtual agent based on the user input.
Step 2:
Initialize variable node is added to initialized and store case status in the variable.
Step 3:
CDS list records action is added to find out case and case status against ticket number entered.
Step 4:
Condition action is added to check the record counts. If record count is equal to 1 then casestatus variable is set to case status details. Else if record count is not equal to 1 then casestatus variable is set to “We have not found any open complaints”.
Step 5:
Send an email notification action is added to send email to user about case status details.
Step 6:
Return value to power virtual agent action send the message to be displayed to the user as a response from the bot.
Check service ticket status Branch:
Customer gets email notification:
Perhaps this article will also give you some inspiration on other ways to make use of Power Automate.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.