Connect Your Power Virtual Agents With The MS Power Automate - Part Three

Overview

 
Welcome to Bot Development with the Microsoft Power Virtual Agent. During this entire article series, we will learn how to create a Chatbot using Microsoft Power Virtual Agent without writing a single line of code. From this series you will learn complete end to end process from development to deployment.
 
I have divided this article series to five Parts.

Use Case

 
In this article, we will connect our Power Virtual Agents ChatBot with Microsoft Power Automate. So, basically, we are providing power to Virtual Agents via Power Automate.
 

Recap

 
In my previous article, we have created a different hierarchy for every problem statement for different IT-related issues. Please find the below screen.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
So, now let’s get started!
 
Step 1
 
Add response for every subcategory. Click on + icon add an action “Show message”. Please add the below message for all four categories.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Step 2
 
Now, let’s add one additional question to take user input about the description of the problem.
 
Add a different question for every category and store the value to the different variables.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Step 3
 
Now, to send an email with the provided description, let’s call a Microsoft Flow or Power Automate from the Power Virtual Agents.
 
Now, let’s pick up the first option : VM
 
Click on + icon and add node > Call an action
 
Connect Your Power Virtual Agents With The MS Power Automate
 
This will open a pop up. Click on Create a Flow.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
This will redirect you to the creation of New Flow. It will auto-generate the following Flow.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Now, save the current flow and close the flow.
 
Step 4
 
Now, we need to create a Flow Solution.
 
To create a flow solution, we need to follow the below steps.
 
Click on the Solutions from the left side, and click on New solution.

Connect Your Power Virtual Agents With The MS Power Automate 
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Once the solution is created, add our existing flow to the solution.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Open the solution and click on the Add existing option.
 
From Outside solutions, select a flow and click on add button.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
This will add a flow to the solution.
 
Step 5
 
Now, click on Edit Flow. At the end of the creation of the flow, the entire structure of the flow will look like below. 
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Now, let's explore each step in detail.
 
First we will create three Input variables, which we pass from Power Virtual Agents to Flow. (Step 1 from the flow screen)
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Add One Variable to return an Output and add default message as shown in the above screen. (Step 2 from flow screen)
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Now, send the below email. (Step 3 from flow screen)
 
Connect Your Power Virtual Agents With The MS Power Automate
 
At last, let’s send a response back to Power Virtual Agents. If Send Email action succeeds, we need to send a response like - "The ticket has been generated successfully." In the same way, if any send email action fails, we need to send a message - "Something went wrong; please try again after some time".
 
So, now let's set our output variable which we have initialized in the (2) step.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Click on elipses and click on Configure Run after. (Step 4 from flow screen)
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
Select "is successful".
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
Now, let's return output variable to Power Virtual Agents. (Step 5 from flow screen)
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
Now, let's set a variable if email notification fails.
 
Add a parallel branch.
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
Set output variable.
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
Click on elipses and select "Configure Run After". (Step 7 from flow screen).
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
 Select "has failed".
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
Return output variable.
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
So, at the end, our flow will look like below.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Save the flow.
 
Step 5
 
Once our flow is created, refresh Power Virtual Agents screen.
 
Add a node again > Call an action
 
Now, you can see the the flow from the solution which we have just created.
 
Select Flow.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
This will add the following box.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Set the Input and Output variable.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Step 6
 
Repeat Step 5 for the other three categories.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Step 7
 
In response, print a message coming from a flow.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Step 8
 
Add a node > End the Conversation > End with Survey
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Now, let’s test the ChatBot.
 
Connect Your Power Virtual Agents With The MS Power Automate 
 
Publish your bot.
 
Connect Your Power Virtual Agents With The MS Power Automate
 
Now, in my next article, we will deploy the Chatbot to Microsoft Teams. Stay connected.
 

Conclusion

 
This is how we can connect Microsoft Power Automate with Microsoft Power Virtual Agents. Hope you love this article.
 
Stay connected with me for more amazing articles!!
 
Happy Chat Botting!!