Practice Lab 7.1 – Power Virtual Agents
Scenario
You are a Power Platform functional consultant and have been assigned to the Fabrikam project for the next stage of the project.
In this practice lab, you will review the existing chatbot. You will explore and enhance the bot.
Exercise 1 – Getting started
In this exercise, you will acquire a PVA trial and examine the components in the chatbot.
Task 1.1 – Sign up for a PVA trial
-
Navigate to the Power Apps Maker portal https://make.powerapps.com.
-
Make sure you are in the Practice environment.
-
Select Solutions.
-
Click to open the Fabrikam Chatbot solution.
-
In the Objects pane on the left, select Chatbots.
-
Click on the Environmental Support Bot chatbot.
-
If you are prompted to start a trial, sign in with your Microsoft 365 credentials and click Continue.
-
Click Get Started.
-
Click Get Started again.
-
Select United States click Get Started.
Task 1.2 – Test the bot
-
In Power Virtual Agents, select Topics. You should see three user topics for Air, Soil, and Water along with the system topics.
-
If the Test bot pane is not showing, click Test your bot to show the bot.
-
Type Hi and click Send.
-
The bot should show the greeting message.
-
Type How can I be a sustainable farmer? and click Send.
-
Select Soil.
-
Select Soil management practices.
-
Select Yes.
-
Click on a rating.
-
Select Yes.
In the list of topics, click on the Water topic to open the authoring canvas.
-
In the Text bot pane, type What are ways of conserving water? and click Send. You should see the authoring canvas show the question node.
-
Type At home and click Send. You should see the authoring canvas show the message node.
-
Click on a rating.
-
Select Yes.
-
Select Topics and then click on the Air topic to open the authoring canvas.
-
In the Text bot pane, type How can I reduce air pollution? and click Send.
-
You should see a list of projects in the Test bot pane and in the authoring canvas you should see the Action node that calls a Power Automate flow that retrieves the list of projects from Dataverse.
-
Select No.
-
Select Reprhase.
-
Click on Hide bot.
Task 1.3 – Review topics
-
Select Topics and then click on the Greeting topic to open the authoring canvas.
-
You should see 50+ trigger phrases and three message nodes.
-
Review the trigger phrases for this topic.
-
Select Topics and then click on the Soil topic to open the authoring canvas.
-
Review the trigger phrases for this topic.
-
You should see four message nodes followed by a question node that uses multiple choice options.
-
Select Topics and then click on the Water topic to open the authoring canvas.
-
Review the trigger phrases for this topic.
-
You should a message node followed by a question node that uses a custom entity called WaterHelp for choices. Note that the response is saved in a variable.
-
Select Topics and then click on the Air topic to open the authoring canvas.
-
Review the trigger phrases for this topic.
-
You should a message node followed by an action node that calls a Power Automate cloud flow.
-
The list of project returned by the flow is stored in a variable that is shown in another message node.
-
Click on View flow details.
-
Click Edit the flow** and review the actions in the flow.
-
Close the flow editor.
Task 1.4 – Review entities
-
Select Entities
-
Select WaterHelp. You should see three items with synonyms.
-
Click on X to close the entities pane.
Exercise 2 – Enhance the chatbot
In this exercise, you make changes to topics and entities.
Task 2.1 - Change greeting
-
Navigate to the Power Apps Maker portal https://make.powerapps.com.
-
Make sure you are in the Practice environment.
-
Select Solutions.
-
Click to open the Fabrikam Chatbot solution.
-
In the Objects pane on the left, select Chatbots.
-
Click on the Environmental Support Bot chatbot to edit the chatbot.
-
In Power Virtual Agents, select Topics.
-
Click on the Greeting topic to open the authoring canvas.
-
Select the first Message and replace the message with the text below.
Hi! I'm a virtual agent. I can help you with environmental sustainability options.
-
Select the second Message and replace the message with the text below.
If you would like to speak to a human at any time, just let me know.
-
Click on the ellipses (…) on the the last message and select Delete.
-
Click Add node.
-
Select Ask a question.
-
Enter What can I help you with? for question.
-
Select the Environment Categories entity for Identify
-
Click on Select options for user.
-
Check all three boxes for Soil, Water, and Air.
-
Under Save response as, click on Var.
-
In the Variable properties pane, enter varCategory for Name.
-
Click on X to to close the variable pane.
-
Under the question, click Add node.
-
Select Add a condition.
-
In the condition, select varCategory for Select a variable and select Air for the value.
-
Above the condition, click Add node and select Add a condition.
-
In the condition, select varCategory for Select a variable and select Soil for the value.
-
Above the condition, click Add node and select Add a condition.
-
In the condition, select varCategory for Select a variable and select Water for the value.
-
You should have four condition branches.
-
Under the Air condition, click Add node and select Redirect to another topic.
-
Select Air.
-
Under the Soil condition, click Add node and select Redirect to another topic.
-
Select Soil.
-
Under the Water condition, click Add node and select Redirect to another topic.
-
Select Water.
-
Under the All other conditions condition, click Add node and select Redirect to another topic.
-
Select Confirmed Failure.
-
Click Save.
-
If the Test bot pane is not showing, click Test your bot to show the bot.
-
Type Hey and click Send.
-
The bot should now use your updated greeting message and a prompt to select the category.
Task 2.2 - Trigger phrases
-
Select Topics and then click on the Soil topic to open the authoring canvas.
-
In the action bar, click Trigger phrases.
-
Type How can I farm sustainably? and click on the + icon.
-
Click on X to to close the Trigger phrases pane.
-
Click Save.
Task 2.3 - Entity
-
Select Entities
-
Select Environment Categories.
-
Click + Synonyms for Soil.
-
Type Land and click Add.
-
Click Done.
-
Click + Synonyms for Water.
-
Type Aquatic and click Add.
-
Type Marine and click Add.
-
Type River and click Add.
-
Type Lake and click Add.
-
Click Done.
-
Click Save.
-
Click on X to to close the Environment categories phrases pane.
Task 2.4 - Fallback
-
Click Settings in the top-right of Power Virtual Agents.
-
Select System fallback.
-
Click + Add.
-
Click Go to fallback topic. The authoring canvas for the Fallback topic will open.
-
Select the first Message node and replace the message with the text below.
I'm sorry I didn't understand
-
Click on caret in the message, select variables {x} and select UnrecognizedTriggerPhrase.
-
Click on the ellipses (…) on the the Redirect node and select Delete.
-
Click on + Add node and select Redirect to another topic.
-
Select Confirmed Failure.
-
Click Save.
Exercise 3 – Publish the bot
In this exercise you will publish the chatbot.
Task 3.1: Publish
-
Navigate to the Power Apps Maker portal https://make.powerapps.com.
-
Make sure you are in the Practice environment.
-
Select Solutions.
-
Click to open the Fabrikam Chatbot solution.
-
In the Objects pane on the left, select Chatbots.
-
Click on the Environmental Support Bot chatbot to edit the chatbot.
-
In Power Virtual Agents, select Publish.
-
Click Publish and then click Publish again wait for publishing to complete.
Task 3.2: Demo website
-
Click on the demo website link under Share your bot.
-
Interact with chatbot on the demo website and see how it performs.
Task 3.3: Channels
-
In Power Virtual Agents, click and expand Manage.
-
Click Channels.
-
Select Custom website and view the embed code.
-
Click on X to to close the Custom website pane.
-
Select Slack and view Bot ID and Tenant ID.
-
Click on X to to close the Slack pane.
Task 3.4: Artificial Intelligence
-
Click AI capabilities.
-
Check the box for Topic overlap detection.
-
Click Save.