Search code examples
botframeworkmicrosoft-teamsadaptive-cards

How do I change the Adaptive card once the user input is submitted?


Though there were few questions regarding the similar, I don't see any working solution.

I am working on a BOT for a feedback. Currently the user is able to send multiple responses by clicking on the options provided in the adaptive card. I am trying to replace the adaptive card with a plain adaptive card that just has some plain text like , "You have chosen option 3".


Solution

  • The following from the link provided in above comments by subbu helps in resolving the same.

    var activity = MessageFactory.Attachment(card.ToAttachment());
    activity.Id = turnContext.Activity.ReplyToId;
    await turnContext.UpdateActivityAsync(activity, cancellationToken);
    

    We went with just deleting the card & sending a default response once user submits as that was enough.