Our use of cookies

We use cookies to tailor your experience, gather analytics, and provide you with live assitance. By clicking "Accept" or continuing to browse our site you agree to the use of cookies. For more details please read our Cookie Policy.

Create a Power Virtual Agent and integrate it with a SharePoint list

by Danish Ali Detho | O365 & Power Platform Solution Architect

Introduction

Virtual agents and bots have become an essential part of customer support in every business. It provides the fastest way to provide the information a customer is looking for without waiting for a customer support agent or searching through a website. They can cover large no of use-case scenarios including providing product information, helping with flight/hotel bookings, or tracking orders.
Today we will take a look at how easy it is to create a Power Virtual Agent and integrate it with a SharePoint list using PowerAutomate Flow.

Microsoft bot framework provides the capabilities for developers to create a bot using programming however Microsoft has recently introduced something for business users to create virtual agents to solve business problems in the form of Power Virtual Agents. Power Virtual Agent is the newest addition to the Power Platform family and is very much focused on the same type of low-code, accessible to everyone from business users to the professional developer in order to provide a platform for building conversational agent that’s AI-driven, tightly integrated with other platform components and can actually solve real business problems.

Scenario

Create a power virtual agent that provides information about the total price and total current stock of the product requested by the customer.

SharePoint List

First off, let’s create a product list that will hold the data of the products with the following fields.

Product list

Columns

  • Title (Single Line of Text)
  • Unit Price (Money)
  • Current Stock (Number)

Create a Power Virtual Agent

Let’s open the power virtual agent studio using the link https://powerva.microsoft.com/ and sign in.
Note: You can signup for a free trial to try it out.

Open bots panel and then click on new Bot. Enter name, select language, and Environment and then press create. This will spin up a new power virtual agent bot.

Note: It takes few minutes for the bot to setup.  

Once the bot is created, we need to define a topic and add some phases. The topic is a way of separating different jobs a bot can perform and phases are used to activate a specific topic. Bot can switch between various topics and a topic is triggered by a phrase. So, let’s add a topic “Search Product” and some common phrases.

Next step is to define the flow of conversation in the authoring canvas. This is where you will define the actions and responses of our bot and the questions to ask the user for information.

Let’s ask the user which product he is looking for and then save it in a product variable. Add a question on the canvas.

Now we will use “Call an Action” to call a PowerAutomate Flow for fetching the items from the SharePoint List. ProductName will be used as an input. In the flow, we will use GetItems with the FilterQuery Title eq ‘ProductName’ to get the items based on the user input and then return the items count and results back to bot.

Note: To get item count use the following expression length(body(‘Get_items’)?[‘value’])

Now we will concatenate the results using a compose action and the following expression concat(item()?[‘Title’],’ – ‘,item()?[‘UnitPrice’],’ – ‘,item()?[‘CurrentStock’]

Power automate flow will return two variables to the power virtual agent containing the item count and the results. Now we will use condition to check if Count =0, then inform user that no products are found and start over again. If Count > 0 then show the results.

Now our bot is ready for testing. We can test the bot in the chat window on the left.  You will notice that the execution of the flow of conversation is visible in the authoring canvas as well.

Summary

In this article, we covered the basics of the power virtual agents and how easy it is to create a bot that can serve as a virtual agent to provide information to the customer. We then implemented a search product scenario where the user can search for product pricing and stock from a SharePoint List using a power automate flow.

 

 

Latest articles

Build your Apps in MS Teams with MS Dataverse for Teams

27 Jun 2022

MS Teams has become one of the most widely used tools for team collaboration and communication in organizations using Microsoft echo-system for […]
[read article]

Dataverse: A one-stop-shop for your App data storage and management

24 May 2022

Data is at the centre of any business application development and is often the deciding factor for which tech. stack to be used for the development. […]
[read article]

AxioWorks Newsletter April 2022: Still working on the next release of SQList…

30 Apr 2022

Hello Reader, Welcome to another exciting issue of our monthly Newsletter! Each month, we try our best to bring to you content that is relevant and […]
[read article]

What’s coming in Power Platform Release wave one of 2022

21 Apr 2022

Due to the ever-rising popularity of the Power platform, Microsoft continues to focus on improving the usability and versatility of the Power […]
[read article]

AxioWorks Newsletter March 2022: Working on the next release of SQList

30 Mar 2022

Hello Reader, Welcome to another exciting issue of our monthly Newsletter! Each month, we try our best to bring to you content that is relevant and […]
[read article]

How to Efficiently Develop and Deploy Solutions in Power Platform

20 Mar 2022

With the Emergence of Low Code to No-Code development platforms, developers have been ever so busy developing solutions utilizing those platforms […]
[read article]

AxioWorks Newsletter February 2022: A good month

28 Feb 2022

Hello Reader, Welcome to another exciting issue of our monthly Newsletter! Each month, we try our best to bring to you content that is relevant and […]
[read article]

Five most awesome features in MS Lists

20 Feb 2022

Microsoft Lists previously known as SharePoint Lists have been widely used for maintaining and storing data in SharePoint and its usage has grown […]
[read article]

AxioWorks Newsletter January 2022: Hello 2022, good bye Covid (we hope)

31 Jan 2022

Hello Reader, Welcome to another exciting issue of our monthly Newsletter! Each month, we try our best to bring to you content that is relevant and […]
[read article]

What went down at MS Ignite 2021: Power Automate and Power Virtual Agent Edition

14 Jan 2022

When we talk about the biggest annual tech conferences of the year, Microsoft Ignite comes to mind where not only do we get a view of all their […]
[read article]

Get SharePoint and SQL news to your inbox

Stay up-to-date with industry news and trends, SQL and SharePoint innovations and all the latest from AxioWorks by subscribing to our monthly newsletter.

Subscribe to the AxioWorks newsletter

*