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

  1. Navigate to the Power Apps Maker portal https://make.powerapps.com.

  2. Make sure you are in the Practice environment.

  3. Select Solutions.

  4. Click to open the Fabrikam Chatbot solution.

  5. In the Objects pane on the left, select Chatbots.

  6. Click on the Environmental Support Bot chatbot.

  7. If you are prompted to start a trial, sign in with your Microsoft 365 credentials and click Continue.

  8. Click Get Started.

  9. Click Get Started again.

  10. Select United States click Get Started.

Task 1.2 – Test the bot

  1. In Power Virtual Agents, select Topics. You should see three user topics for Air, Soil, and Water along with the system topics.

  2. If the Test bot pane is not showing, click Test your bot to show the bot.

  3. Type Hi and click Send.

  4. The bot should show the greeting message.

  5. Type How can I be a sustainable farmer? and click Send.

  6. Select Soil.

  7. Select Soil management practices.

  8. Select Yes.

  9. Click on a rating.

  10. Select Yes.

In the list of topics, click on the Water topic to open the authoring canvas.

  1. 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.

  2. Type At home and click Send. You should see the authoring canvas show the message node.

  3. Click on a rating.

  4. Select Yes.

  5. Select Topics and then click on the Air topic to open the authoring canvas.

  6. In the Text bot pane, type How can I reduce air pollution? and click Send.

  7. 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.

  8. Select No.

  9. Select Reprhase.

  10. Click on Hide bot.

Task 1.3 – Review topics

  1. Select Topics and then click on the Greeting topic to open the authoring canvas.

  2. You should see 50+ trigger phrases and three message nodes.

  3. Review the trigger phrases for this topic.

  4. Select Topics and then click on the Soil topic to open the authoring canvas.

  5. Review the trigger phrases for this topic.

  6. You should see four message nodes followed by a question node that uses multiple choice options.

  7. Select Topics and then click on the Water topic to open the authoring canvas.

  8. Review the trigger phrases for this topic.

  9. 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.

  10. Select Topics and then click on the Air topic to open the authoring canvas.

  11. Review the trigger phrases for this topic.

  12. You should a message node followed by an action node that calls a Power Automate cloud flow.

  13. The list of project returned by the flow is stored in a variable that is shown in another message node.

  14. Click on View flow details.

  15. Click Edit the flow** and review the actions in the flow.

  16. Close the flow editor.

Task 1.4 – Review entities

  1. Select Entities

  2. Select WaterHelp. You should see three items with synonyms.

  3. 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

  1. Navigate to the Power Apps Maker portal https://make.powerapps.com.

  2. Make sure you are in the Practice environment.

  3. Select Solutions.

  4. Click to open the Fabrikam Chatbot solution.

  5. In the Objects pane on the left, select Chatbots.

  6. Click on the Environmental Support Bot chatbot to edit the chatbot.

  7. In Power Virtual Agents, select Topics.

  8. Click on the Greeting topic to open the authoring canvas.

  9. 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.

  10. 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.

  11. Click on the ellipses (…) on the the last message and select Delete.

  12. Click Add node.

  13. Select Ask a question.

  14. Enter What can I help you with? for question.

  15. Select the Environment Categories entity for Identify

  16. Click on Select options for user.

  17. Check all three boxes for Soil, Water, and Air.

  18. Under Save response as, click on Var.

  19. In the Variable properties pane, enter varCategory for Name.

  20. Click on X to to close the variable pane.

  21. Under the question, click Add node.

  22. Select Add a condition.

  23. In the condition, select varCategory for Select a variable and select Air for the value.

  24. Above the condition, click Add node and select Add a condition.

  25. In the condition, select varCategory for Select a variable and select Soil for the value.

  26. Above the condition, click Add node and select Add a condition.

  27. In the condition, select varCategory for Select a variable and select Water for the value.

  28. You should have four condition branches.

    Condition and branches.

  29. Under the Air condition, click Add node and select Redirect to another topic.

  30. Select Air.

  31. Under the Soil condition, click Add node and select Redirect to another topic.

  32. Select Soil.

  33. Under the Water condition, click Add node and select Redirect to another topic.

  34. Select Water.

  35. Under the All other conditions condition, click Add node and select Redirect to another topic.

  36. Select Confirmed Failure.

  37. Click Save.

  38. If the Test bot pane is not showing, click Test your bot to show the bot.

  39. Type Hey and click Send.

  40. The bot should now use your updated greeting message and a prompt to select the category.

Task 2.2 - Trigger phrases

  1. Select Topics and then click on the Soil topic to open the authoring canvas.

  2. In the action bar, click Trigger phrases.

  3. Type How can I farm sustainably? and click on the + icon.

  4. Click on X to to close the Trigger phrases pane.

  5. Click Save.

Task 2.3 - Entity

  1. Select Entities

  2. Select Environment Categories.

  3. Click + Synonyms for Soil.

  4. Type Land and click Add.

  5. Click Done.

  6. Click + Synonyms for Water.

  7. Type Aquatic and click Add.

  8. Type Marine and click Add.

  9. Type River and click Add.

  10. Type Lake and click Add.

  11. Click Done.

    Custom entity and synonyms.

  12. Click Save.

  13. Click on X to to close the Environment categories phrases pane.

Task 2.4 - Fallback

  1. Click Settings in the top-right of Power Virtual Agents.

  2. Select System fallback.

  3. Click + Add.

  4. Click Go to fallback topic. The authoring canvas for the Fallback topic will open.

  5. Select the first Message node and replace the message with the text below.

    I'm sorry I didn't understand

  6. Click on caret in the message, select variables {x} and select UnrecognizedTriggerPhrase.

  7. Click on the ellipses (…) on the the Redirect node and select Delete.

  8. Click on + Add node and select Redirect to another topic.

  9. Select Confirmed Failure.

    Fallback topic.

  10. Click Save.

Exercise 3 – Publish the bot

In this exercise you will publish the chatbot.

Task 3.1: Publish

  1. Navigate to the Power Apps Maker portal https://make.powerapps.com.

  2. Make sure you are in the Practice environment.

  3. Select Solutions.

  4. Click to open the Fabrikam Chatbot solution.

  5. In the Objects pane on the left, select Chatbots.

  6. Click on the Environmental Support Bot chatbot to edit the chatbot.

  7. In Power Virtual Agents, select Publish.

  8. Click Publish and then click Publish again wait for publishing to complete.

Task 3.2: Demo website

  1. Click on the demo website link under Share your bot.

  2. Interact with chatbot on the demo website and see how it performs.

Task 3.3: Channels

  1. In Power Virtual Agents, click and expand Manage.

  2. Click Channels.

  3. Select Custom website and view the embed code.

  4. Click on X to to close the Custom website pane.

  5. Select Slack and view Bot ID and Tenant ID.

  6. Click on X to to close the Slack pane.

Task 3.4: Artificial Intelligence

  1. Click AI capabilities.

  2. Check the box for Topic overlap detection.

  3. Click Save.