3

In my bot i have an adaptive card with submit button. Can i modify card or disable button or delete this card on submit action ?

  • Would be good to share more details of your code and examples of the issue, but I believe I understand. You are saying that after the adaptive card is used (clicked on or whatever) you want it to go away so a user can't scroll back up and hit a button again? I don't know how to do that but I am interested in a solution as I can see how that could cause issues with your dialog flow. – billoverton Feb 13 '20 at 22:34
  • Hi Andrii Have you managed to do it? Because I only get 400 error when I try to execute UpdateActivity – Kostya Vyrodov Nov 22 '20 at 19:34

1 Answers1

2

In Teams you have the option of updating your card message. So you can use something like:

var newActivity = MessageFactory.Attachment(myUpdatedCard);
newActivity.Id = activityId //the Id of the original activity you sent;
await turnContext.UpdateActivityAsync(newActivity, cancellationToken);

To send a new version of the card.

Andrew Clear
  • 7,910
  • 5
  • 27
  • 35