Escalating to Teams from PVA

In previous post we have understood the option of using Power automate to escalate the conversation from PVA to Teams. In this post lets actually configure this to understand the technical details.

Lets edit any existing bot or create new bot. Now in transfer to agent topic we can call a power automate which will connect to Teams and create a new chat session and add all live agents to that session along with the user.

Lets navigate to Escalate topic

Under Escalate topic, we will see on talk to agent step and one message has been added below this. We may change this message to inform user that bot is transferring the conversation to the agent

Then lets click on the “+” button to add new step and select “Call for Action”. Under this select “Create a flow”. Here flow is power automate flow.

If you click on create flow, it will navigate you to the power automate creation page to create new power automate or you can see existing power automates listed and you can select the existing one as shown below

Once we create the flow and add it here, we can see the input parameters which we can pass to Power automate and the return parameter which we can get from power automate back to PVA as shown below

Either by creating a new flow or by clicking on “View flow details” we can navigate to the flow design

Here we can see four steps in the power automate out of which are two the first one and last one are coming out of box from the template and middle two are added for Teams escalation logic.

First step receives the parameter from PVA, we can add number of parameters as per our requirement. Here we have added the User Name as a parameter which will be used to create the Teams chat session. To access the is user ID we need to enable the authentication in the PVA from security and select for Teams. This would provide the id of the person who is using this BOT from MS Teams

Then next step it to create a chat session, we can add members to added in the session. Just keep it in mind that the Power automate user would be automatically added in this session. so make sure that the the Service account has proper Teams license to create the Teams chat. Lets give the title for the chat session. Either we can add names of individual agents or create a team of agents and add that team here to avoid hard coding.

Now we want to post some message to this chat, so add Post message in the chat r channel. Conversation ID would come from above step and lets enter the message to be shown in the group chat

Then we can add the link as the output parameter which can be shown to the user chat

When we test this functionality, lets deploy the bot on the Teams channel if not deployed earlier (refer to my post Power Virtual Agent Channels to see how to deploy the bot to Teams channel)

Here user can see the bot in the Teams and start chatting with the bot

When user mentions that they want to talk to the agent , the flow get triggered and a new session is visible to user in the Teams. It also gives a link to the chat session just for reference . I did this to demonstrate the output parameter from the flow to PVA

Now all the agents are added to the Teams and available agent initiates the conversation with the user in this chat.

In this post we have seen how to escalate to Teams from PVA.

I hope this helps to continue learning PVA 😊

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.