Add chatbot to a page (preview)
[This article is pre-release documentation and is subject to change.]
Power Apps portals allow you to add a Power Virtual Agents chatbot to answer questions posted by a visitor on your portals page. A chatbot (bot) configured with different topics and trigger phrases can automatically respond to questions posted by a visitor in a chat conversation.
- This is a preview feature.
- Preview features aren’t meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
Before you can add a Power Virtual Agents bot to a Power Apps portals page, you must create a bot first. If you don't already have an available bot or one that fits your needs, you'll have the option in portals to go to Power Virtual Agents to create one. To learn how to create a bot, go to Create and delete Power Virtual Agents bots.
This feature requires the following versions for starter portal package and portal host:
Add chatbot component
Once you have a chatbot created, you can add this component to a portals page with the following steps:
Go to Power Apps Preview.
Select Apps from the left pane.
Select your portal.
Select Edit to open the portals Studio.
Select Components from the left pane.
Select Chatbot component.
Select your bot.
If you don't have a bot already created, or want to create a new bot to use in portals, select Power Virtual Agents. After you create your bot, select Sync configuration inside portals Studio to reflect the bot changes.
Select whether the bot appears on all pages in your portal, or on specific pages.
If you select Specific pages, use Manage bots in pages to control the pages that can use this bot.
You can add more bots from your environment across different pages in a portal. For example, a bot that answers questions related to the workplace can be added to an HR page. Or a bot that answers basic payroll queries can be added to a Finance page. However, you can't have one page use more than one bot.
The chatbot component is rendered using a web template called Power Virtual Agents.
You can change the values for the following parameters inside the "window.PvaEmbeddedWebChat.renderWebChat()" function.
|width||Uses variable "chatWidth". To change, update the width in pixels:
|height||Uses variable "chatHeight". To change, update the height in pixels:
|headerText||Title of the bot. By default, this uses the bot's name. To change, add "headerText" parameter with the bot header value:
|webChatHeaderStyleOptions||Determines header style for the chatbot component, such as color of font and background. To change, update "webChatHeaderStyleOptions" parameter with the values for "fontColor" and "backgroundColor" properties:
After changing the web template, ensure you select Sync configuration to update the configuration and reflect the changes.
Any changes to the Power Virtual Agents web template other than the parameters explained above are not supported.
Consider the following when using a Power Virtual Agents chatbot inside portals:
Portal template version
This feature requires the starter portal package version 9.2.2103.x or later. If your portal template isn't upgraded to add support for the chatbot component, you'll see following message when you try to add the component:
"Portal upgrade required: An upgrade is required to use this feature on your portal. If you upgrade the portal, ensure you Sync Configuration to refresh your current portals Studio session with new portals package."
When this message appears, upgrade your portal package. For more information, see Update portals solution.
Upgrading the starter portal package will enable any additional portals in your environment with the capability to use chatbot component. More information: Starter portal package updates
This feature comes with a portal solution called MicrosoftPortalBot with the display name of Dynamics 365 Portals - Bot. Your portal will stop working if you delete this solution and don't perform the following action.
If you delete the MicrosoftPortalBot solution, you must restart your portal to ensure the portal works correctly.
To restart your portal:
Open Power Platform admin center for your portal.
On the left pane, select Portal Actions.
Select Restart to restart the portal.
Restarting the portal will make it unavailable for several minutes and users won’t be able to access the portal URL during this time.
Select Restart to confirm restarting the portal.