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

AxioWorks Newsletter August 2021: We’re working hard

30 Aug 2021

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]

Get the Power of Location-based analytics in Power BI using ArcGIS Maps

16 Aug 2021

In today’s world, data analytics has to become pivotal for making informed decisions and decision-makers are always keen to find new and innovative […]
[read article]

AxioWorks Newsletter July 2021: We’ve expanded!

01 Aug 2021

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]

SharePoint Spaces: Empowering enterprises to build Virtual Reality solutions

31 Jul 2021

The World is moving towards virtual reality which is considered by most tech gurus as one of the technologies of the future. The capabilities offered […]
[read article]

AxioWorks Newsletter July 2021: Building up a successful release in June

03 Jul 2021

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]

We are looking for a Sales and Marketing Manager!

18 Jun 2021

We are looking for someone with experience in the SharePoint and BI arenas to take on the role of Sales and Marketing Manager. You will be able to […]
[read article]

Mover : Only Migration tool you will ever need to move your cloud content to SharePoint

11 Jun 2021

One of the biggest conundrum of any organization planning to move to SharePoint is how to move all their documents stored in various different […]
[read article]

New version of AxioWorks SQList released (7.0.0.0)

04 Jun 2021

A new version of AxioWorks SQList is out today! We have been really busy for the past few months, but here we are with a brand new release of […]
[read article]

AxioWorks Newsletter June 2021: May has been a month of new releases

01 Jun 2021

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]

Form Configuration Editor: Lightweight and Built-in SharePoint List Form editor

16 May 2021

SharePoint Lists provides an easy and robust way of storing and manipulating data in SharePoint.  When you set up a new custom list, you also get OOTB […]
[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

*