Forum Discussion
AyeshaKulsumSJ
Sep 04, 2022Brass Contributor
Error when trying to update adaptive card
I am trying to update the adaptive card in a channel with the click of a button in the Personal bot. But I get the following error. Error: Message does not exist in the thread. const newActivity =...
Nivedipa-MSFT
Microsoft
Sep 04, 2022AyeshaKulsumSJ - Could you please share the console logs.
- NanddeepNachanSep 05, 2022Learn Expert
Please have another look at the Azure Bot configuration for the correct Bot ID from there is mentioned in your code configuration.
Also, as you have channelized the bot to MS Teams, have a look if there are any errors reported.
- AyeshaKulsumSJSep 05, 2022Brass Contributor
Please find logs below
[Message does not exist in the thread. Error: Message does not exist in the thread. at new RestError (node_modules/@azure/ms-rest-js/dist/msRest.node.js:1403:28) at /node_modules/@azure/ms-rest-js/dist/msRest.node.js:2528:37 at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async fnc.]- Nivedipa-MSFTSep 06, 2022
Microsoft
To update the existing card on button selection, you can use
ReplyToIdof incoming activity.To update existing card on a button selection, pass a new
Activityobject with updated card andReplyToIdas activity ID to theUpdateActivityAsyncmethod of theTurnContextclass. See TurnContextClass.var activity = MessageFactory.Attachment(card.ToAttachment()); activity.Id = turnContext.Activity.ReplyToId; await turnContext.UpdateActivityAsync(activity, cancellationToken);Ref Doc: Update and delete messages sent from your bot - Teams | Microsoft Docs