Explanation:
Connect your bot to Omnichannel for Customer Service
1. (E) In Power Virtual Agents, edit your bot. In the left panel, select Manage, Agent transfers, and then select the Omnichannel tile.
2. Select Enable.
3. Under See the environment this bot is connected to, select the environment where you have omnichannel integration turned on.
4. (A) Select See how to register a new Application ID and follow the steps to find or create the app registration for Power Virtual Agents.

5. On the Azure portal go to App registrations, then select Overview. Copy the Application (client) ID
6. Return to the Omnichannel pane in Power Virtual Agents and paste the Application ID in the Application ID box.
Important
Omnichannel for Customer Service models bots as "application users." Therefore, the Application ID that you use must be unique to your Microsoft Dataverse organization or environment.
7. Select Add your bot.
Power Virtual Agents uses a Teams channel to communicate with Omnichannel for Customer Service. If one isn't turned on, a Teams channel will be enabled when you select Add your bot.
8. Select the View details in Omnichannel link to continue configuring the bot connection in your omnichannel interface.
B: End bot conversation
You must configure the Power Virtual Agents web app bot to end a conversation. See End conversation.
When a customer closes the chat window, for the bot to end the conversation in Omnichannel for Customer Service, you must also configure a context variable that explicitly ends the conversation.
To configure a bot conversation to end, perform the following steps:
1. In Power Virtual Agents, for the selected bot, add a new topic.
2. Select Go to authoring canvas, and in Add node, select Call an action, and then select Create a flow.
3. On the Power Automate window that opens on a new tab, do the following:
In the Return value(s) to Power Virtual Agents box, select Add an output, and then select Yes/No.
In the Enter title box, enter CloseOmnichannelConversation, which is the Omnichannel for Customer Service context variable name.
In the Enter a value to respond box, select the Expression tab, and then enter bool(true) to build the expression, and select OK.
Save the changes, and then exit Power Automate.
4. In the topic that you were editing, select Call an action again, and then in the list, select the flow that you created.
5. In Add node, select End the conversation, and then select Transfer to agent.
6. Go to the topic in which you need to invoke the topic for ending the bot conversation in Omnichannel for Customer Service, and use the Go to another topic option in Add a node.
7. Select the topic that you created for ending the bot conversation.
8. Save and publish the changes.