Below is a waterfall method which will display a hero card in the first step. In the second step , it will receive the value and begin a dialog based on the selection. However i am facing a issue when tested in teams. Please find the below details
Code :
async serviceRequestTypes(stepContext) {
const srTypes = stepContext.options;
console.log('INSIDE SR TYPES');
const serviceRequestCard = CardFactory.heroCard('Service Requests', 'Please choose the belwo options to create the appropriate service Requests',
CardFactory.images(['https://www.usnews.com/dims4/USNEWS/65f1856/2147483647/thumbnail/970x647/quality/85/?url=http%3A%2F%2Fcom-usnews-beam-media.s3.amazonaws.com%2Fbe%2Fdd%2F8f25b4174b6398285139452fb7d5%2F190313-collegeapplication-stock.jpg']),
CardFactory.actions([
{
type: 'messageBack',
title: 'Create Generic Service Request',
value: 'Create Generic Service Request'
},
{
type: 'messageBack',
title: 'Create Application Service Request',
value: 'Create Application Service Request'
},
{
type: 'messageBack',
title: 'Create Virtual Desktop Service Request',
value: 'Create Virtual Desktop Service Request'
}
])
);
await stepContext.context.sendActivity({ attachments: [serviceRequestCard], attachmentLayout: AttachmentLayoutTypes.carousel });
return { status: DialogTurnStatus.waiting };
}
}
async classifySRDialog(stepContext) {
console.log('INSIDE CLASSIFY SR DIALOG');
**console.log(stepContext.context.activity.value);
stepContext.values.classifiedSR = stepContext.context.activity.value;**
console.log(stepContext.values.classifiedSR);
if (stepContext.values.classifiedSR === 'Create Generic Service Request') {
return await stepContext.beginDialog('createGenericSRDialog');
} else if (stepContext.values.classifiedSR === 'Create Application Service Request') {
console.log('Inside Application SR');
return await stepContext.beginDialog('createApplicationDialog');
} else if (stepContext.values.classifiedSR === 'Create Virtual Desktop Service Request') {
return await stepContext.beginDialog('createVDIDialog');
} else {
}
}
}
In the second waterfall method i need to get
stepContext.values.classifiedSR = stepContext.context.activity.value;
This is working absolutely fine in bot emulator and webchat . However when the same is tested using microsoft teams .
stepContext.context.activity.value is coming as {} object. Could any please assist.