I know this question is asked many times. But i do not understand any of it. I have an adaptive card called the people-picker in the Bot Framework Composer. It has a choice field called people-picker and a button. The only thing i need is to return the choice of the choice-field the user has chosen by clicking on the button. How can i do that?
when someone clicks Submit on an Adaptive Card, the bot doesn't receive a normal text message , it receives a message activity with empty text and a value object, where each input's id becomes a key. So the choice the user picked lives in turn.activity.value.<yourInputId>. That's the whole trick.
But your screenshot shows the real problem: you're sending the card from a "Send a response" action. That fires the card and immediately moves on, it never waits for the submit, so there's nothing to capture. You need to send it from a question action instead.
you can Try the below:
In the card JSON, give your choice field an id, and don't use hyphens. Name it peoplePicker, not people-picker. In Composer expressions turn.activity.value.people-picker gets read as a subtraction and breaks. (If you must keep the hyphen, reference it as turn.activity.value['people-picker'].)
Replace the "Send a response" with Ask a question with Text input, and set its Prompt to ${AdaptiveCardPeople()} (your existing card template).
On that input action, set:
Property where to store it, e.g. dialog.peopleChoice
Value (under Prompt configurations / advanced) =turn.activity.value.peoplePicker
Max turn count 0
That last setting matters: because the card submit comes back with empty text, the input assumes the user didn't answer and re-prompts the card in a loop. Setting max turn count to 0 stops that. (Some people fix the same loop by making the question the last action in the step, either works.)
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.