Search code examples
c#botframeworkmicrosoft-teamsadaptive-cards

How to edit MS Bot Framework Adaptive Card on submit action


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 ?


Solution

  • 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.