This wasn't an easy post. It was difficult getting to work with Power Automate and actually understanding how it works, BUT, I made it. As Lady Gaga said, you can do anything if you put your mind to it, so here I am...
In this article, we will see how we can use the sentiment analysis functionality from AI Builder to collect inputs and answer them in 3 possible scenarios: positive, negative, or neutral.
Power Automate:
Power Virtual Agents:
Microsoft Teams
First step: Power Virtual Agents
Power Virtual Agent will be the bot that communicates with the employee. You will see later on that because we want to add this solution to a scenario the workers already know, we will add this Power Virtual Agent (step 3).
1. Log into Power Virtual Agents, complete the form and select Create.
2. Under topics, select +New topic and name it as you want. In my case, the topic is already created. I decided to name it Employee feedback, you'll see why.
3. List the trigger phrases that you want your bot to respond to, once you have them listed, add them to the Trigger Phrases box:
Identify: User's entire response
Save response as: VarUserResponse
5. Add an action and then select Create a flow
At this point, a new tab for Power Automate will open looking like the picture below.
Second step: Power Automate
In the first box, complete as shown:
2. Add an action and chose to Analyze positive or negative sentiment in text. Complete as follows.
3. Add another action and select Initialize variable. Complete as shown.
6. Now is when you need to decide how your bot will reply to positive, negative, and neutral inputs. If you are lacking in inspiration see what I've done.
Case: positive. Choose set variable and complete it with the name and text you want people to receive in positive cases.
Case: negative. This case is a bit different because it is a negative input and we want to escalate the feedback received to the HR Team through email. As you can see the first step is the same as the positive case, but here I added an additional step: Send an email (V2) completing the "to" "subject" and "body". Notice that in the body I added a Dynamic field so people receiving the email are aware of the response that was submitted and they can take proper action.
Case: neutral. Luckily this one is simple and pretty similar to the positive one. Complete as follows.
7. We want to save this feedback and sentiment. To do so, we need to select the Create item under Sharepoint actions. You will need:
Site address
List name
Title
8. We will return these values to our HRBot - Power Virtual Agents.
The entire flow you just created must look something like this:
Back to the first step: Power Virtual Agents
1. Once the flow is created, you will notice this new box completed with new information:
2. You'll need to add a new message and include the variable Response.
Step 3: Publish the Power Virtual Agent on Microsoft Teams
Using Microsoft Teams is a smart decision, as adoption will be pretty easy. Employees are used to Teams doing basically everything.
1. In Power Virtual Agents, go to Publish and select Go to Channels.
2. Select Microsoft Teams.
3. A new tab will open. Select Turn on Teams.
5. Change details if you want to, once you are done select Save.
Keep reading here: HR Sentiment analysis with Power Automate + Power Virtual Agents + Microsoft Teams (anainesurrutia.c...
Ana Inés Urrutia | MVP | Dynamics 365 for Human Resources (anainesurrutia.com)
Nice use case
Thank you! I appreciate your feedback.
Keep up to date with current events and community announcements in the Power Virtual Agents community.
A great place where you can stay up to date with community calls and interact with the speakers.