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

Our Favourite Picks from Power BI Global Summit 2023

17 Mar 2023

Power BI Summit is the biggest Power BI conference of the year which ran virtually from 6th March to 10th March. It brought speakers from the […]
[read article]

AxioWorks Newsletter February 2023: Development of SQList new release is in full swing

28 Feb 2023

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

MS List Templates bundled with Power Automate Flow

20 Feb 2023

Microsoft Lists previously known as SharePoint Lists is the go-to option for maintaining and storing data in the world of O365 and its usage has […]
[read article]

AxioWorks Newsletter January 2023: Kicking off 2023 with some great content

30 Jan 2023

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]

A pragmatic approach to obtaining value from your SharePoint data

20 Jan 2023

Organisations have been storing data in SharePoint for more than 20 years.  This data can be as simple as a List used by a small team or a complex […]
[read article]

Power BI Report Server : An On-Premises Report hosting Suite

16 Jan 2023

Power BI has become the most widely used tool for reporting due its user-friendly interface which allows business users to generate sleek and […]
[read article]

AxioWorks Newsletter December 2022: Good bye 2022, welcome 2023!

29 Dec 2022

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

PowerApps Debugging and Troubleshooting made easy with Monitor

28 Dec 2022

Troubleshooting and debugging are an integral part of building and supporting a resilient app especially when it is built using a low-code […]
[read article]

AxioWorks Newsletter November 2022: Is it almost Xmas already?

29 Nov 2022

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

Future of SharePoint in the world of Power Platform

29 Nov 2022

Microsoft SharePoint has been the driving force for enabling virtual team collaboration and the modern workspace revolution over the last three […]
[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

*