[Question]How do you start a dialog via a backchannel triggered event?
SDK Platform: Node.js SDK Version: 3.11.0 Active Channels: web, direct line Deployment Environment: localhost
Question: How do you start a dialog via a backchannel triggered event? I tried doing bot.beginDialog('Welcome-Dialog') and event.beginDialog('Welcome-Dialog') without any luck.
bot.on("event", function (event) {
var msg = new builder.Message().address(event.address);
msg.textLocale("en-us");
if (event.name === "buttonClicked") {
msg.text("Hi "+ event.value.name");
bot.send(msg);
}
bot.begin('Welcome-Dialog')
});
bot.dialog('Welcome-Dialog', function(session,args) {
/* Dialog flow logic */
}).triggerAction( { matches: 'Hi' } );
A working solution would be to store a map of user-id and session and then use seesion.send to send a dialog to the corresponding user .
Thank you for your response, but I am not sure that I understand. Could you provide a brief example?
@jfantell You need to call bot.beginDialog() with the correct arguments, including address and dialogId.
You can find the method signature via VSCode intellisense:

in the Typescript SDK reference doc: https://docs.botframework.com/en-us/node/builder/chat-reference/classes/botbuilder_d.universalbot.html#begindialog
or read the file here: https://github.com/Microsoft/BotBuilder/blob/master/Node/core/src/bots/UniversalBot.ts#L243
Since the bot of type UniversalBot has no access to the session object, you need to grab the address from the event.address and pass it to beginDialog as the first argument. Eg: bot.beginDialog(address, dialogId);
Hi @jfantell - Were you able to get it working using the info provided in my last comment?
Let me know if you still have questions.
reopen if you're still having issues.