ChattBotz

Chatbots in Microsoft Teams | Build with Power Virtual Agents


How you can now use Power Virtual Agents to create intelligent chatbots directly in Microsoft Teams. We’ll also discuss how the integration with the Bot Framework Composer lights up new capabilities for building even richer custom experiences.

So, before we get into this, if you’re new to Power Virtual Agents the service or PVA as it’s called, it’s part of Microsoft’s Power Platform, and it really gives you a zero-to-low-code, AI-rich way to build intelligent chatbots.

So we’ve been focused on how we can expand the use of Virtual Agents to help. Many of us are using Teams as our collaboration platform. So one of the major updates is the integration of Power Virtual Agents. This gives you an instant bot authoring canvas to build intelligent and responsive chatbots without even leaving Teams. And the good news is, that Power Virtual Agents is included in your Teams license.

And just to put this into context, we’ve had the ability to create simple bots in Teams for a while now, but this takes things to another level, right? – It does. If you’re one of the millions of Teams users today, you’re probably predominantly using it for a chat or online meetings. With Power Virtual Agents, you can build custom virtual chat experiences to engage with your team. For example, as a manager or an HR professional, you can quickly build an FAQ chatbot for Teams, or maybe you want to address frequently asked questions about returning to work during this time of COVID-19. Or if you’re in IT, you can save time by creating intelligent service desk chatbots that triage common IT questions. – Great, so can you show us an example? – Absolutely. So I’ll start an example of the chatbot that I’ve already built, and then I’ll show you how easy it was to create it within Teams. I have here, an HR assist chatbot that enables employees to ask questions about time off, public holidays, how many days do they have left, etc.

So I’ll type ‘want info on national holidays.’ And you see it shares that information. Let’s try something harder. I’ll type ‘how many vacation days do I have?’ And it asks me to choose between national holidays or paid time off. I’m going to choose paid time off. And it looks like I’ve got zero days left. And that was totally natural interaction there. And there’s obviously thought a lot happening behind the scenes, including some integration than with your user profile, maybe the backend HR system that can track the vacation days that you have left.

Unfortunately, zero at the moment. But, how did you build all this out? – It’s pretty simple. Really, anyone can author chatbots like this. First, let me tell you how to get Power Virtual Agents for Microsoft Teams. You go to the app store, or you can click on the ellipse and search for Power Virtual Agents, click on add for me. And here’s the app in the navbar. Let’s pin it so it’s always present for quick access.

From here, I can go ahead and create my first bot. So we’ll click start now. I select my team that I want it associated with. I want this one and we’ll click continue. And now I can give my chatbot a name. Let’s call it HR assist, select a language, and that’s it. I have my chatbot and I’m ready to start adding content. So that looked pretty simple, but how easy is it to build then that interaction that we saw earlier? – It’s super simple. Here’s the Power Virtual Agents left-hand nav. Let’s expand that out this first time through so you can see. We’re going to the topics list page, and you can see that the chatbot comes with some out-of-box content, a few sample topics, and some system topics, which are pre-built responses like a standard welcome or goodbye message.

And I’m going to create a new topic that focuses on time off. I’ll click on the plus, the new, give my topic a title, ‘Employee time off,’ and add a few trigger phrases. What are the national holidays, need info on time off, how many vacation days do I have, I need help with time off. Now, I’ll go to the authoring canvas and we can see trigger phrases here at the top. And I can populate this message node with info pointing the user to an internet site that’s got info on paid time off. Keeping it very simple to start with. So I’ll paste in the message with the links for further information, I’ll save it and we’ll test it.

Let’s type, where do I go to get info about time off? And here you see the bot is providing a response. And that’s really a great option to just get users the information that they need as fast as possible. But how did you create that more complex interaction that we saw earlier? So that’s the beauty of PVA. Your chatbot uses AI to make decisions and take action.

I’m going to delete that message node that we had there. And instead, I’m going to ask a question. We’re going to ask, what info are you looking for? And that’s going to present two options. I’m going to present national holidays and paid time off. Notice that the dialogue has automatically branched creating two conditional nodes for us. And now I’m going to go ahead and store the user selection as a variable.

And I’m going to call that leave type, so we can more easily track it in the topic. For national holidays, I’m going to go ahead and add the content here directly. Now for paid time off, I want to do a look-up in our HR app and see how many vacation days I have to remain. And for this, I’m going to add an action, that calls a Power Automate flow called get vacation balance to do that lookup, which I pre-created here in the interest of time. And if you’ve not used Power Automate before, it gives you access to hundreds of pre-built connectors to connect to existing apps and services. – So, do you need to do anything then to specialize or personalize the response to the user? How does it know for example, who was making the request? – Well, because the user’s already signed into Teams, we know who they are, we know their alias, etc. So we can use that information as input.

You can see, it takes the user’s display name as an input here, and it returns the variable balance as an output. Let’s add a message node to output that info to our user. ‘You have X days remaining.’ We’re ready to save and test it. And we’ll enter, ‘we want info on national holidays,’ and you can see that the bot is smart enough to skip over that question and instead directly display the national holidays. So, as I recall though, it’s using a capability that’s called Entity Slot Filling, really to skip over the questions that it already has answers for. That makes the conversation more streamlined and efficient. Now, let’s also test the vacation days portion of the dialogue. I’ll reset and I’ll type ‘need info on time off.’ And you can see it’s calling a flow, doing the lookup based on my user details. I’m going to choose paid time off and you can see, I’ve got eight days remaining. And that’s so much better than having zero days left.

So what else can you do to customize the chatbot? This is where Power Virtual Agents becomes a bridge between your business users and professional developers who can build out even richer experiences for you. But we’ve had the ability for a while though, to call a bot that we created using the Azure Bot Framework as a skill from within PVA before, right? – Yeah we have, but this is different. We’ve just released to the public a preview of our deep integration of Power Virtual Agents with the Azure Bot Framework Composer.

So what are some of the things I can do there? You can author much richer experiences, such as adaptive dialogues that give you a way to code complex event-driven dialogues. For example, you want to look up a flight and you want to see what the weather is like in that location at the same time. And the bot can easily switch contexts mid-conversation and then switch back. Or language generation that dynamically varies the chat responses, so they appear less robotic. Or adaptive cards that give you a rich, interactive display and enable you to incorporate images and videos. That sounds pretty amazing.

On the topics list page, you can click, open Bot Framework Composer to launch it. Now, if you haven’t already installed it, it will install it for you from GitHub. Here it’s pre-installed. So now it’s starting to import the bot content from PVA over into Composer, and it will prompt you to sign in the first time you do this.

To add a request leave dialogue, specifically for folks needing to take a longer leave, say for medical purposes. You can see here that he’s already prebuilt and intent trigger, which fires upon detection of one of the trigger phrases: request leave, extended leave, maternity, and paternity leave. Now Power Virtual Agents natural language understanding is being used for the intent recognition behind the scenes here.

This is going to call a new dialogue that will present an adaptive card to the user asking them to provide the from and to dates and the reason, and then to click on submit when they’re done. And that will call a Power Automate flow to notify the HR specialist that there’s a new request to approve. And you can see he’s adding a response that goes back to the employee to let them know that the request has been sent to the HR specialist for consideration. You can see here, these are the bot responses he’s created. This is where he’s sending the adaptive card and this is the adaptive card he created to send back to the user. So now, he’s going to publish those changes back into PVA. And once that’s completed, you can see here the request leave trigger and the request leave dialogue imported into PVA, and now it’s integrated and ready to use. So how then do you make the chatbot available within Microsoft Teams for other people to discover and use it? – So that’s our final step.

Let’s navigate over to publish, click on the publish button and confirm, and that’s going to propagate out the content that we’ve just added and make it available. We’re also going to click on the, share the bot, and this is how we make it visible to other folks within the app store. We have a couple of options here. You can see submit for admin approval. If that’s approved, your bot will be made available across an entire tenant, so that everyone in your organization can use it. Or more commonly you’ll want to do add to Teams.

And this makes the bot visible in the share with colleagues section within the app store. We’re going to share with our team for demo purposes. So let’s close that and navigate out to the app store to show you where to find it. We click on the ellipse and more apps. Then under Built for Contoso, you’ll probably see your own company name here, and we’ll scroll down to the bottom.

And there’s a section where you can see called built by your colleagues, and you’ll find it. You want to install it and pin it to the left-hand nav. So I’m going to actually try this out. First I’m going to make a request, and it looks like I’m out of vacation days like you were earlier. And I need info then on extended leave, so I’ll ask that.

Now the bots can actually prompt me for a form to complete. And you can see it’s asking me to provide things like the from and the to date range, and a reason. So I’ll say the medical procedure, need time off to recover, and then I’ll hit submit, and that’s going to go to an HR specialist for review. So now I’m logged in as the HR specialist, and in the HR specialist channel, I can see your request has come in and I can review it.

Everything looks good. So I’ll hit approve. So you’ve seen how easy it is to create a new Power Virtual Agents bot in Microsoft Teams. You can start simple and add intelligence as you need to. And you could even extend it with custom capabilities, leveraging the Bot Framework Composer.

Read More: How to Create Twitter Bots

Leave a Reply

Your email address will not be published. Required fields are marked *