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.
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.
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.
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
This will open a pop up. Click on Create a Flow.
This will redirect you to the creation of New Flow. It will auto-generate the following Flow.
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.
Once the solution is created, add our existing flow to the solution.
Open the solution and click on the Add existing option.
From Outside solutions, select a flow and click on add button.
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.
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)
Add One Variable to return an Output and add default message as shown in the above screen. (Step 2 from flow screen)
Now, send the below email. (Step 3 from flow screen)
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.
Click on elipses and click on Configure Run after. (Step 4 from flow screen)
Select "is successful".
Now, let's return output variable to Power Virtual Agents. (Step 5 from flow screen)
Now, let's set a variable if email notification fails.
Add a parallel branch.
Set output variable.
Click on elipses and select "Configure Run After". (Step 7 from flow screen).
Select "has failed".
Return output variable.
So, at the end, our flow will look like below.
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.
This will add the following box.
Set the Input and Output variable.
Step 6
Repeat Step 5 for the other three categories.
Step 7
In response, print a message coming from a flow.
Step 8
Add a node > End the Conversation > End with Survey
Now, let’s test the ChatBot.
Publish your bot.
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!!