I'm having a problem retrieving the activityID of a Choice prompt once the selection has been made within a waterfall dialog. Im currently making use of a Teams channel.
An example my code can be found below. In the step after the selection, if I have a look at the stepContext object(found further below), there is reference of an Activity.id, but this id is infact the Activity id for the current step. I'm sure I'm missing something simple, but cant figure it out.
async step1(step) {
const choice1 = await step.prompt(CHOICE_PROMPT, {
prompt: 'Please select one of the following:',
choices: ChoiceFactory.toChoices(['Option1', 'Option2', 'Option3'])
});
return choice1
}
async step2(step) {
console.log(step)
console.log("...........................................................................")
return await step.prompt(NAME_PROMPT, 'Please insert your name')
}
WaterfallStepContext {
dialogs:
DialogSet {
dialogs:
{ NAME_PROMPT: [Object],
CHOICE_PROMPT: [Object],
CONFIRM_PROMPT: [Object],
ATTACHMENT_PROMPT: [Object],
WATERFALL_DIALOG: [Object] },
dialogState: undefined },
context:
TurnContext {
_respondedRef: { responded: false },
_turnState:
Map {
Symbol(BotIdentity) => [Object],
Symbol(ConnectorClient) => [Object],
Symbol(OAuthScope) => 'https://api.botframework.com',
'botCallbackHandler' => [AsyncFunction],
Symbol(state) => [Object],
Symbol(ActivityReceivedEmitted) => true },
_onSendActivities: [],
_onUpdateActivity: [],
_onDeleteActivity: [],
bufferedReplyActivities: [],
_adapter:
BotFrameworkAdapter {
middleware: [Object],
BotIdentityKey: Symbol(BotIdentity),
OAuthScopeKey: Symbol(OAuthScope),
ConnectorClientKey: Symbol(ConnectorClient),
TokenApiClientCredentialsKey: Symbol(TokenApiClientCredentials),
settings: [Object],
credentials: [Object],
credentialsProvider: [Object],
isEmulatingOAuthCards: false,
authConfiguration: [Object],
turnError: [AsyncFunction] },
_activity:
{ text: 'Option1',
textFormat: 'plain',
type: 'message',
timestamp: 2020-05-05T13:32:42.187Z,
localTimestamp: 2020-05-05T13:32:42.187Z,
id: '1588685562137',
channelId: 'msteams',
serviceUrl: 'https://smba.trafficmanager.net/za/',
from: [Object],
conversation: [Object],
recipient: [Object],
entities: [Array],
channelData: [Object],
locale: 'en-US' } },
stack: [ { id: 'WATERFALL_DIALOG', state: [Object] } ],
state: DialogStateManager { dialogContext: [Circular] },
_info:
{ index: 1,
options: {},
reason: 'endCalled',
result: { value: 'Option1', index: 0, score: 1, synonym: 'Option1' },
values: { instanceId: 'b5bef7ce-1c43-e1db-abc0-651ed2b5bb8f' },
onNext: [Function: onNext] },
parent:
DialogContext {
dialogs: DialogSet { dialogs: [Object], dialogState: [Object] },
context:
TurnContext {
_respondedRef: [Object],
_turnState: [Object],
_onSendActivities: [],
_onUpdateActivity: [],
_onDeleteActivity: [],
bufferedReplyActivities: [],
_adapter: [Object],
_activity: [Object] },
stack: [ [Object] ],