You can enhance your Power Pages portal by embedding Power Virtual Agents (chatbots) to guide users, handle FAQs, or assist with tasks like form filling and support.
Use Cases
- Self-service help desks
- Guided troubleshooting
- Appointment scheduling
- Live agent escalation
- Interactive form support
Steps to Embed Power Virtual Agent
1. Create a Power Virtual Agent Bot
- Go to Power Virtual Agents
- Create a bot with topics, trigger phrases, and responses
- Publish your bot when you’re done
2. Get the Embed Code
- In Power Virtual Agents:
- Go to Settings > Channels
- Choose Custom Website
- Copy the JavaScript embed code
3. Embed in Power Pages
- Open your Power Pages portal
- Go to Pages > select a page or your main layout
- Use a Web Template or HTML Component
- Paste the chatbot code before the closing
</body>
tag
<!-- Power Virtual Agent Bot -->
<script src="https://web.powerva.microsoft.com/webchat/chatwidget.js"></script>
<script>
window.botpressWebChat.init({
botId: 'YOUR_BOT_ID',
hostUrl: 'https://powervirtualagents.microsoft.com',
// Optional customization
showChatButton: true,
openOnLoad: false,
locale: 'en'
});
</script>
Replace
'YOUR_BOT_ID'
and host URL with the ones from your bot’s settings.
Optional Customizations
- Change theme color
- Control when it opens
- Add logic to show chatbot only on certain roles or pages
{% if user %}
<!-- show bot for logged-in users -->
{% endif %}
Security Considerations
- Avoid sharing sensitive data through bot conversations
- Use role-based access if your bot should respond differently to internal vs. external users
Summary
Integrating Power Virtual Agents in Power Pages enables:
- 24/7 customer interaction
- Scalable support
- Smart conversational UX