web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Adaptive Cards with Dy...
Copilot Studio
Unanswered

Adaptive Cards with Dynamic multi choice questions

(0) ShareShare
ReportReport
Posted on by

I am upgrading a Chatbot project from PVA version 1 to version 2. 

 

With version 1 I was able to implement a dynamic multiple choice question using bot framework combine with PVA.

 

With version 2 this is no longer possible and the only way I can implement this is by using Adaptive Cards specifically version 1.6

 

Having said this, it seems that Adaptive Cards v1.6 is not yet supported by PVA v2. 

 

Do you have any idea when this version will be supported? Or maybe managed to work around this in some other way?

Categories:
I have the same question (0)
  • HenryJammes Profile Picture
    on at

    Hi @Anonymous,

     

    Do you have an example of the dynamic multiple option adaptive card JSON?

    Curious to understand what property works in 1.6 but not in 1.5 for your scenario.

     

    Henry

  • Community Power Platform Member Profile Picture
    on at

    I am referring to this feature: https://adaptivecards.io/explorer/Input.ChoiceSet.html

    backnight1991_0-1698659807421.png

     

    The below sample gives an error in PVA unless the version is downgraded to 1.5 which leaves the dynamic input.ChoiceSet to be unsupported.

    {
     "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
     "type": "AdaptiveCard",
     "version": "1.6",
     "body": [
     {
     "type": "Input.ChoiceSet",
     "id": "snooze",
     "label": "Snooze for",
     "value": "${reminders.overrides[0].minutes}",
     "choices": [
     {
     "$data": "${reminders.overrides}",
     "title": "${minutes} minutes",
     "value": "${minutes}"
     }
     ]
     }
     ],
     "actions": [
     {
     "type": "Action.Submit",
     "title": "Snooze",
     "data": {
     "x": "snooze"
     }
     }
     ]
    }

     

  • HenryJammes Profile Picture
    on at

    Downgrading to 1.5 works for me.

    Can you provide more details on what part should be dynamic and is not in your test?

     

    HenryJammes_0-1698661222805.png

     

  • Community Power Platform Member Profile Picture
    on at

    The list would be fetched dynamically from an array or json string return from a PA flow ex:

     

    1200-1300

    1300-1400

    1400-1500

    1500-1600

     

    The below is what should fetch the array dynamically from PVA context by addressing them via: Topic.Slots

     

    {
     '$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
     type: "AdaptiveCard",
     version: "1.6",
     body: [
     {
     type: "Input.ChoiceSet",
     choices:
     ForAll(Topic.Slots,
     {
     text: Text(slot),
     type: "TextBlock",
     size: "medium"
     }
     )
     }
     ],
     actions: [
     {
     type: "Action.Submit",
     title: "slot",
     data: {
     x: "slot"
     }
     }
     ]
    }

     

  • Verified answer
    HenryJammes Profile Picture
    on at

    Hi @Anonymous 

     

    I got it to work this way:

     

    HenryJammes_0-1698662251788.png

     

    In my repro, I initialize your array in a JSON format (like it would be passed from Power Automate) and then parse it as a table in PVA. The biggest difference is how I add the dynamic options to my adaptive card:

     

    HenryJammes_1-1698662340061.png

     

    Here's my topic YAML if you want to repro locally in a new topic:

     

    kind: AdaptiveDialog
    beginDialog:
     kind: OnRecognizedIntent
     id: main
     intent:
     displayName: Input.ChoiceSet
     triggerQueries:
     - Input.ChoiceSet
    
     actions:
     - kind: SetVariable
     id: setVariable_mVSHGE
     variable: Topic.SlotsJSON
     value: [ "1200-1300", "1300-1400", "1400-1500", "1500-1600" ]
    
     - kind: ParseValue
     id: j3NiV2
     variable: Topic.SlotsTable
     valueType:
     kind: Table
     properties:
     Value: String
    
     value: =Topic.SlotsJSON
    
     - kind: AdaptiveCardPrompt
     id: QTAqiH
     card: |-
     ={
     '$schema': "http://adaptivecards.io/schemas/adaptive-card.json",
     type: "AdaptiveCard",
     version: "1.5",
     body: [
     {
     type: "Input.ChoiceSet",
     id: "snooze",
     label: "Snooze for",
     value: "Snooze",
     choices: ForAll(Topic.SlotsTable,
     {
     title: Value,
     value: Value
     }
     )
     }
     ],
     actions: [
     {
     type: "Action.Submit",
     title: "Snooze",
     data: {
     x: "snooze"
     }
     }
     ]
     }
     output:
     binding:
     actionSubmitId: Topic.actionSubmitId
     snooze: Topic.snooze
     x: Topic.x
    
     outputType:
     properties:
     actionSubmitId: String
     snooze: String
     x: String
    
     - kind: SendActivity
     id: sendActivity_w7gOrx
     activity: You selected {Topic.snooze}

     

    Let me know if that helps

  • Community Power Platform Member Profile Picture
    on at

    Cannot thank you enough. 🙏 Worked like a charm 👌

     

    I really could not find anything regarding the possible attributes for the ForAll loop. 

     

    Now is clear. thanks again.

  • HenryJammes Profile Picture
    on at

    Thank you @Anonymous -- that is good feedback and we are currently working on documenting more examples and use cases for dynamic adaptive cards / Power Fx.

  • non7775 Profile Picture
    4 on at

    I got this one work too, 

    Thanks James

Under review

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.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 255 Super User 2025 Season 2

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 205 Super User 2025 Season 2

#3
S-Venkadesh Profile Picture

S-Venkadesh 101 Moderator

Last 30 days Overall leaderboard