Now, let start building our solution. Head over to http://aka.ms/TryPVA and sign in with your Microsoft account. You would be directed to Microsoft's Power Virtual Agent home page.
Fill in the above details correctly:
Click 'Create' when you are done filling in the details. You would be directed to your bot's home page. In the right navigation bar, click 'Topics'. On the page that displays, you would 12 existing topics. A topic defines how a bot conversation plays out. In this sample, we would create new topics from scratch. Topics have trigger phrases — these could be phrases, keywords, or questions that a user is likely to type. We also have conversation nodes — these are what you use to define how a bot should respond and what it should do.
Delete the first 4 topics. To do so, open each topic and click on 'Delete' at the top right of the page. After deleting the topics, you would be left with 8 existing topics. Now let's create a new topic for our survey. On that same page, click on '+ New topic' at the top. Give your topic a name. I would name mine "TakeASurvey". In the section 'Trigger Phrases', input up to 5 possible phrases your employee would type in. These phrases would automatically start the survey.
Next, click on 'Go to authoring canvas'. The authoring canvas is where you define the bot's conversation pattern. You would notice that a blank Message node was automatically added. In the empty box, input your welcome message. Mine is below.
Thank you for taking out time to respond to this survey. We appreciate you!
The goal of this short survey is to ensure that you are enjoying being part of our organization. Please fill in only once!
Add another node by clicking the '+' icon and 'Show a message'. We need to add a message telling the employee a little bit about the survey. Notice that a new empty text box is added to the flow. In that box, input the details below.
This survey consists of 4 questions.
For each question, you are expected to tell us how you feel. 0 stands for lowest and 5 for highest.
Be assured that your anonymous responses would go a long way in making our organization better.
Now we would ask which department our employee is responding from. To add this question, click on the '+' icon again, and this time click on 'Ask a question'. Notice that as you do, a different type of block is added to the flow.
Fill in the details correctly.
Next, we need to add each question and the options. We repeat the steps above. Click on the '+' icon again, and click on 'Ask a question'.
Fill in the details of the block correctly.
Notice that as you add a new option, multiple condition blocks are added beneath the question block.
After each question is answered by the employee, the bot is expected to ask the next question. To make this happen, we need to add a new node to one of the conditions. Click on the '+' sign and then 'Ask a question'. Fill in the block correctly.
Now we need to connect all condition blocks earlier to the second question. We do this so that whatever the response to the first question is, the second question would still be asked. To do this, click on the '+' sign and instead of adding a node, click on the small circle and connect to the second question block. Repeat this process for all conditions. Your flow should look like the image below.
Repeat this process for questions 2 and 3 - question 2 connecting to question 3 and question 3 connecting to question 4. After the 4th question, our bot should thank the employee for taking out time to fill the survey. To make this happen, add a 'Show a message' node to the flow, type in a short thank you message and connect all conditions to the message as shown in the image below.
You can test your bot to make sure it's working well by clicking 'Test your bot' on the left side of the page. CONGRATULATIONS ON SUCCESSFULLY BUILDING YOUR BOT!
Now let's connect our bot to our SharePoint using Power Automate. We start by adding a new node to our bot after the thank you message. Remember how to add a node? Just click on the '+' sign. This time we would pick 'Call an action' then 'Create a flow'. Clicking 'Create a flow' would open up Power Automate in a new window.
Notice that two actions have been automatically added to our Power Automate flow. In the first action, Power Automate is establishing a connection with our Power Virtual Agent bot. We need to add each question the bot would ask as input. To add the questions, click on '+ Add an input', then 'Text'. Notice that when you do, a new input box is added. Repeat this step for all the questions and fill in the details correctly.
We would head over to our Power Virtual Agent bot now and beneath the last message, we would add a new node but this time a 'Call an action'. You would notice that a new flow has been added to the list "Power Virtual Agents Flow Template". Select it. Immediately you do, you would notice the flow opens up. Something like the image below.
Now we need to select a variable name for each input. Remember we said our variable names would be used later to identify inputs? Now it's time to make use of them. Select the variable name that matches each question as shown below.
The second action automatically added to our Power Automate flow returns the values of the first action to Power Virtual Agents. We would need to create an output for each input entered in the first action. Repeat this step for all the inputs and fill in the details correctly.
Our Power Virtual Agent flow would collect the response from the bot using the variable name assigned and use it as an output which would be used to create an item on our SharePoint list. To automatically create an item on our SharePoint list, we would need to add a new action to our Power Automate flow.
Head over to Power Automate and click '+ New step', search for "Create item (SharePoint)" and select. If you haven't already, you would need to sign in to SharePoint to create a connection. Click on 'Site Address' and select the SharePoint site you created your SharePoint list in. Click on 'List Name' and select the specific SharePoint list you created for this solution. Fill in correctly the Power Virtual Agent output that you want each column of your SharePoint List to work with.
In the end, your flow should look like the image below.
Your SharePoint List would check for the response to those questions and update it to the specified column. Now save your Power Automate flow and your Power Virtual Agents bot and test the bot again. When you completely respond to all questions and have received the thank you message, you would notice that a new response would be automatically added to SharePoint.
HOLLA! :woman_dancing::man_dancing::sparkles::sparkles: CONGRATULATIONS ON REACHING THIS MILESTONE!
You can now publish your Power Virtual Agent bot by clicking 'Publish' in the left navbar. Then on the page that opens up, click Publish.
We would need to share our Power Virtual Agent bot on Microsoft Teams so our employees can access it. To do so, head over to 'Manage' and click on 'Channels'. On the new page that opens up, click on 'Microsoft Teams'. Your page should look like the one in the image below.
Click on 'Turn on Teams' so your bot would be turned on. To give everyone in your organization access to the bot, click on 'Availability options'. Select 'Show to everyone in my org' and 'Submit for admin approval' then 'Yes' to complete submission to administrators of your organization's Microsoft Teams if you are not one.
If you are one of the administrators in your organization's tenant, click here to learn how to approve the bot for everyone in your organization. When published, your employees can head over to the 'Apps' section of Microsoft Teams under "Built for your org", find the bot and add.
Here are additional resources for you to check out:
Building a scheduled reminder for this solution with Adaptive Card
Visualizing your SharePoint data with Power BI
Building your anonymous survey solution with Power Apps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.