Showing results for 
Search instead for 
Did you mean: 

[Announcement] Make your Power Virtual Agents bot start the conversation using a custom canvas

Make your Power Virtual Agents bot start the conversation using a custom canvas blog:







@Anonymous - You need to deploy your custom canvas code to start the conversation automatically.

Not applicable


I did but the error persists. 
In the sample HTML page it works: file://cyg7006/users$/8233/Documents/chatbot/index.html

I cannot link our deployed page because it's out intranet on SharePoint, but in the demo website you can see that the message is not coming up


Could I be doing something else wrong?

I used the code from and only changed the name, colours and bot name

<!DOCTYPE html>
<title>Contoso Sample Web Chat</title>
html, body {
height: 100%;
body {
margin: 0;
h1 {
font-size: 16px;
font-family: Segoe UI;
line-height: 20px;
color: whitesmoke;
display: table-cell;
padding: 13px 0px 0px 20px;
.heading {
background-color: blue;
height: 50px;
.main {
margin: 18px;
border-radius: 4px;

background-color: black;
#webchat {
position: fixed;
height: calc(100% - 50px);
width: 100%;
top: 50px;
overflow: hidden;
<div class="heading">


<div id="webchat" role="main"></div>
<script src=""></script>
const styleOptions = {
// Add styleOptions to customize web chat canvas
hideUploadButton: true

var BOT_ID = "de070903-2993-49e5-8028-1e5952c31484";

var theURL = "" + BOT_ID;

const store = window.WebChat.createStore(
({ dispatch }) => next => action => {
if (action.type === "DIRECT_LINE/CONNECT_FULFILLED") {
meta: {
method: "keyboard",
payload: {
activity: {
channelData: {
postBack: true,
//Web Chat will show the 'Greeting' System Topic message which has a trigger-phrase 'hello'
name: 'startConversation',
type: "event"
return next(action);
.then(response => response.json())
.then(conversationInfo => {
directLine: window.WebChat.createDirectLine({
token: conversationInfo.token,
store: store,
styleOptions: styleOptions
.catch(err => console.error("An error occurred: " + err));

Hey anonymous did you deployed your power virtual agent chatbot in SharePoint site ?as a extension or Webpart.if you know how to show me the way.

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Top Solution Authors
Users online (5,458)