When I was a little girl, I remember my dad excitedly explaining the internet to me. He talked about how one day we’d be able to talk to people instantly who were across the world, how there would be robots to talk to and how we’d even be able to do all our shopping through the computer! I thought he had lost it a little bit, but the excitement in his eyes was clear to see. Needless to say, I never ever imagined that I would be that person building those bots! Please welcome Power Virtual Agent to our Power Platform family!
What is Power Virtual Agent?
First off – what is Power Virtual Agent? Well, PVA is the latest addition to the Power Platform family and allows us to create super smart bots or virtual assistants within minutes – no code required! It allows an end user to interact with a bot to garner information, submit complaints, get shopping recommendations or even navigate their own personal adventure. As PVA is built right on top of the CDS, we can link in Power Platform functionality such as Power Automate for retrieving records from Model Driven Apps, to creating case records for us. PVA brings us a host of new opportunities to the Power Platform community.
Cool! Let’s Get Started!
Getting started with PVA is probably the easiest of the Power Platform applications to spin up and can be accessed by going to https://powerva.microsoft.com/. When you first log in, you’ll be asked to create your bot. Be careful – ensure you have the right environment selected before hitting Create!
While your bot is being created, you’ll see a super cute little bot animation – I love it! Hi, Bob!
In this scenario, I am designing a bot for our local brewery to help patrons decide what kind of beer to order! To achieve this, we’re going to take a deep dive into Topics.
Topics are a key component of PVA – they how the bot interprets input and responds. The bot will come pre-built with many topics. System Topics perform vital functions which can be customised but cannot be deleted. User Topics are ones that can be created, customised and deleted where needed. We’re going to open the Greeting Topic and make some changes.
It’s more common to kick off a topic flow with a “Trigger Phrase” which the bot will patiently listen for. While the Trigger Phrases for a system topic cannot be modified (In the greeting case, there are 52 trigger phrases, so it’s got us covered), we can make changes to how the bot greets a guest and how they interpret their input by clicking on “Go to authoring canvas”. Here, I have modified Bob’s standard greeting to a more suitable one:
Once we have modified the greeting, we can test it in real time by saving the topic changes and clicking “Test your Bot” in the bottom left corner. This will pop out the bot simulation and allow us to see the flow of the conversation. I have typed in “Hello” to kick the bot off:
At this stage the bot is now waiting for the end user’s input. This is where we’re going to create our first User Topic. Our first topic is going to be instructions on how to order drinks. Select “Topics” from the sidebar and click “New Topic” in the top left corner. Here we will name the Topic and add some Trigger Phrases:
Once we have added some Trigger Phrases, we’re going to start building out the flow. Click on “Go To Authoring Canvas”. This particular store allows for both online and in person ordering, so the bot is going to ask the end user a question to determine what information to provide. When opening the Authoring Canvas, we have a number of actions we can take, including the “Ask a Question” action:
Asking a question allows the end user to input data or select an option which the bot can then use to process and respond with relevant information. Here we’re going to provide the end user with a multiple choice question:
Note that the end user’s response is stored as a text variable called “OrderState”. Variables can be either Topic (specific to the topic, like a local variable) or Bot (can be referenced elsewhere by the bot, think global variables). This is important to note in case you need to refer back to the end user’s response later on. In our case, we only need this information for right now, so we’ll set it to Topic.
Now we’ll flesh out the two different paths. If the end user selects Online, we will display instructions for online ordering. In person will display the store’s address:
This conversation can either be set to end here or we can redirect it to another topic. I have built out a topic called “Store Hours” that I’m going to redirect the end user to after having displayed the physical location of the store to the end user:
Now we have a few flow options, let’s test the bot! Turn on “Track between topics” at the top to watch the flow of the conversation through various topics:
The End of Conversation option will prompt the bot to ask if they answered the end user’s question, to which the end user can respond with yes or no. Yes will ask the end user to rate the efficiency of the bot and no will prompt the end user to rephrase their question or transfer the end user to a human agent.
Now you have a completed bot, we need to publish it! Be sure to click on Publish in the sidebar. There are a number of ways to deploy the, including a wonderful Demo Website that can be used to share with colleagues and friends to test out:
You can check out the progress of this bot by following along here! We will be adding more functionality including a Beer Quiz!
Let me know on Twitter how you’re using PVA – build some cool things!