Botframework-webchat: sending and receiving events from webchat in Bot Composer

Created on 12 Aug 2020  路  6Comments  路  Source: microsoft/BotFramework-WebChat

Hi,

I am able to dispatch an event (with custom name) from webchat and capture it in bot composer using 'Event received ' trigger
as shown in below screenshot.

Eventreceived

But how can I post or send an event activity from bot composer to webchat?

馃毃 The issue tracker is not for implementation questions 馃毃

[Question]

Bot Services Question customer-replied-to customer-reported

All 6 comments

@madbeher - Have you tried using Send a response with an activity structured response template with "event" as the type property?

we tried using the solution you mentioned and it is working for us. Thanks for providing quick solution.

@madbeher - You're welcome, glad to hear it

Hi,

I am able to dispatch an event (with custom name) from webchat and capture it in bot composer using 'Event received ' trigger
as shown in below screenshot.

Eventreceived

But how can I post or send an event activity from bot composer to webchat?

馃毃 The issue tracker is not for implementation questions 馃毃

[Question]

Hi, can you help me with one question,
does this 'event recived' is like the proactive message? if not do you know how to create proactive alerts with the Composer?

@madbeher Would you be willing to give some insights off how you achieved to send an event activity from bot composer to webchat? If possible could you share to send the response message you created and the code you used to catch the event in the webchat?

Hello @zuercher8353 ,
I'm testing it with:

[Activity
type = event
name = WEB_CHAT/SEND_EVENT
value = welcome
]

in a "send response" body in composer and I catch it on webchat side with:

   const store = window.WebChat.createStore({}, ({ dispatch }) => next => action => {

          console.log(" Action  " + action.type);

      if (action.type === 'DIRECT_LINE/INCOMING_ACTIVITY' && action.payload.activity.type === 'event'){
        console.log('Event received from backend :' + action.payload.activity.value);
      }
     return next(action);
   });
Was this page helpful?
0 / 5 - 0 ratings

Related issues

compulim picture compulim  路  3Comments

felixhauserch picture felixhauserch  路  3Comments

vikramdadwal picture vikramdadwal  路  3Comments

prashanthsridhar picture prashanthsridhar  路  3Comments

corinagum picture corinagum  路  3Comments