pdeeepa
pdeeepa

Reputation: 49

MS Teams: Adaptive Cards

I have a Chatbot developed in Microsoft Bot framework which uses an Adaptive Card (v1.2) to get inputs from the Users.

enter image description here

I fill the form details and then I click the Submit button. I am able to extract the values successfully but the adaptive card gets reset to the default values (becomes empty form).

This strange behavior happens only in MS Teams.

Any solution to maintain the updated form with the user inputs or this is the expected behavior?

Upvotes: 1

Views: 598

Answers (1)

Kyle Delaney
Kyle Delaney

Reputation: 12264

In order to preserve Adaptive Card input values in Teams, you need to do the following:

  1. Insert a unique identifier into the submit action's data object
  2. Save the activity in bot state so that it may be retrieved using the identifier
  3. When you get an incoming activity with the identifier and the input values, modify the Adaptive Card in the saved activity so that it contains the new input values and then update the activity in Teams with the modified Adaptive Card

Preserving Adaptive Card input values is one of the main features of my upcoming cards library. You can express your support on that GitHub page if you're interested.

Upvotes: 3

Related Questions