Bring AI to your life with Power Virtual Agents and Microsoft Graph
Published Aug 17 2022 04:12 AM 1,592 Views

Ever wondered how to bring AI to your day-to-day work? This blog will focus Power Virtual Agents, particularly how to build conversational BOTs with Microsoft Graph. We are going to return user's calendar meeting information through BOT interaction. Some extending ideas could be getting Planner or important email data. This post serves as a foundation and an inspiration.


So, let's go ahead and get into the content!




Objectives and Prerequisites

So why this content is important? I am sure much like myself, most of you are inundated with a lot of information, which is spread across many services like Email, Calendar, SharePoint, etc. To find the right focus from the disparate data, we can bring this information together by using Power Virtual Agents and Graph.

Thus, our goal is to...

  • Introducing bots, explaining where they are being used, and providing an overview of how Power Virtual Agents can be used to create bots
  • Reviewing the process for creating a bot and how to work with the Power Virtual Agents user interface
  • Illustrating the process of publishing a bot and successfully solving our problem

To get those objectives, you should have...

  • Access to Power Virtual Agents
  • Relevant permissions including enabled delegation to access user calendar

Why Microsoft Power Virtual Agents in Education?

Microsoft Power Virtual Agents empowers teams to create powerful bots through a guided, no-code graphical interface. With Power Virtual Agents, we can eliminate the gap between the subject matter experts and development teams that are building the bots, and can reduce latency between teams recognizing an issue and updating the bot to address the issue.

Each one of us wears multiple hats at work sometimes. For example, a university professor may be a lecturer, a researcher and a faculty staff for one semester! Hence, there could be a lot of different meetings and projects. To navigate through information efficiently and interactively, our chatbot would come to the field. It can help to show a list and give suggestions, just like a personal assistant.





Moreover, it includes the following features to enhance your bot's functionality to make it even more powerful:

  • Initiate Microsoft Power Automate flows, which is being used in our following demo
  • Pass conversations to live agents. Bots can be configured to pass conversations, including the context to live agents
  • Automate topic creation. You can extract content from existing support pages, such as Frequently Asked Questions (FAQs)

How to get started?

The first time that you sign into Power Virtual Agents and create a new bot, a default environment is created. Unless specified otherwise, any additional bots will be created in the default environment. If additional environments are needed, such as for different regions, organizational needs, or other circumstances, they can be added through the Microsoft Power Platform admin center.

When in the admin center, you can add environments by going to the Environments tab and selecting New to open the new environment panel.



You can create bots by selecting the bot icon in the Power Virtual Agents interface.



In the Create a new bot dialog box, enter a name for your bot. Select Create to begin the bot-building process, which can take up to 15 minutes for the first bot that you create in an environment.




You will define any additional topics by selecting Topics in the side navigation pane and then selecting New topic at the top of the page. Each topic that you define should include some trigger phrases. Trigger phrases are examples of text such as questions or utterances that teach the bot when to respond with this dialog.




After you have saved your topic, you can define how customers are guided through their conversational interaction with the topic. You can define the path by selecting Go to authoring canvas. The authoring canvas is a graphical dialog tree editor that allows you to define bot responses and the overall bot conversation. When the canvas loads, the conversation will consist of two nodes:

  • The trigger phrases that will initiate the topic.
  • The initial message that will be provided to the user.



Conversation nodes help define the path that the conversation will take. Conversation nodes can display messages, ask questions, or run actions. You can add these nodes by selecting the plus sign (+) below the node. For example, if you want to provide store hours based on where the customer lives, you would add an Ask a question node to identify which store location that they want the hours for.

The following image shows the Ask a question node being used to ask the customer which store location they want the hours for. In addition, the customers are provided with two multiple-choice options to choose from: Seattle and Bellevue.





You can test your bot in real time by using the test bot panel, which you can enable by selecting Test your bot at the bottom of the side navigation pane.




By testing your bots often throughout the creation process, you can ensure that the conversation flows as anticipated. If the dialog does not reflect your intention, you can change the dialog and save it. The latest content will be pushed into the test bot, and you can try it out again.


When you are ready to publish your bot, select the Publish tab on the side navigation pane. During the publishing process, the bot will be checked for errors. Bot publishing typically takes a few minutes. When the publish is successful, the top of the page will display a green banner indicating that everything worked correctly. If errors are detected, you will be notified through a message that is displayed in the application.




After a bot is deployed and customers are interacting with it, statistics that are related to the bot will become available. You can access this information through the Analytics tab in the side navigation pane. This pane provides key performance indicators (KPIs) that show the volume of sessions that your bot has handled, how effectively your bot was able to engage users and resolve issues, escalation rates to human agents, and abandonment rates during conversations.



For step-by-step exercise to create a bot, please check out this learn module.

How to connect my BOT with Graph?

It is not hard to connect with Graph with your Bot. However, we'll involve Power Automate as well. For our solution Architecture, we are going to use Power Virtual Agent Triger, HTTP Action to connect Office 365 Graph API, and then do some data processing to break it down and pull only the information we need. Lastly, we will send them back through the PVA Return Values action by using markdown.

For specific steps and final demo, please check out this video!

Next Steps

Interested in learning more about Power Virtual Agent? Here are some resources for you to explore:

Final Note

Splendid work if you read till the end! We learned what is Power Virtual Agent and where they are being used. We walked through how to create bot and connect it with Graph APILet us know if this post is helpful. Thank you for reading and we are proud of your learning mindset!

Version history
Last update:
‎Aug 17 2022 04:16 AM
Updated by: