Forum Discussion

sallerabi11's avatar
sallerabi11
Copper Contributor
Aug 25, 2025

Dynamic Adaptive Cards

Hello, 

I'm a teacher and currently trying to build a co-pilot agent for self assessment of an exam or many exams. Therefore I build a Sharepoint list with all the competences for every exam (or more likely going to). With the help of a flow I create a code for an adaptive card. 

Now I use this flow in a copilot agent to create an adaptive card in a conversation, where the student can do the self assessment. So far I was able to show the adaptive card as I want to but struggling to get the answers of the user. Because I don't create the adaptive card in the topic on it's own but use the output of the flow as a variable, I think some things get a bit more complicated (please correct me if I'm wrong)

 

This would be a part of the JSON of my adaptive card, which I create through the flow. And again the competences are different depending on the exam, so I will always have different id's and I don't know how to handle this. (I cut off some of the items.)

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.5",
    "actions": [
        {
            "type": "Action.Submit",
            "id": "submitSelfAssessment",
            "title": "Antworten senden",
            "data": {
                "action": "submitSelfAssessment",
                "examId": "Klausur_Vektorrechnung"
            },
            "associatedInputs": "auto"
        }
    ],
    "body": [
        {
            "type": "TextBlock",
            "text": "Selbsteinschätzung - Klausur_Vektorrechnung",
            "weight": "Bolder",
            "size": "Large"
        },
        {
            "type": "Container",
            "style": "emphasis",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "Koordinatensysteme",
                    "weight": "Bolder"
                },
                {
                    "type": "Input.ChoiceSet",
                    "id": "ans_Koordinatensysteme_Zeichnen",
                    "style": "expanded",
                    "label": "Zeichnen von einem dreidimensionalen Koordinatensystem. ",
                    "choices": [
                        {
                            "title": "Sehr unsicher",
                            "value": "1"
                        },
                        {
                            "title": "Eher unsicher",
                            "value": "2"
                        },
                        {
                            "title": "Mittel",
                            "value": "3"
                        },
                        {
                            "title": "Eher sicher",
                            "value": "4"
                        },
                        {
                            "title": "Sehr sicher",
                            "value": "5"
                        }
                    ],
                    "isMultiSelect": false,
                    "wrap": true
                },
                {
                    "type": "Input.ChoiceSet",
                    "id": "ans_Koordinatensysteme_Punkte",
                    "style": "expanded",
                    "label": "Ich kann Punkte in ein Koordinatensystem eintragen und die Koordinaten richtig ablesen. ",
                    "choices": [
                        {
                            "title": "Sehr unsicher",
                            "value": "1"
                        },
                        {
                            "title": "Eher unsicher",
                            "value": "2"
                        },
                        {
                            "title": "Mittel",
                            "value": "3"
                        },
                        {
                            "title": "Eher sicher",
                            "value": "4"
                        },
                        {
                            "title": "Sehr sicher",
                            "value": "5"
                        }
                    ],
                    "isMultiSelect": false,
                    "wrap": true
                },
                {
                    "type": "Input.ChoiceSet",
                    "id": "ans_Koordinatensysteme_AbstandMittelpunkt",
                    "style": "expanded",
                    "label": "Ich kann Abstände und Mittelpunkte berechnen",
                    "choices": [
                        {
                            "title": "Sehr unsicher",
                            "value": "1"
                        },
                        {
                            "title": "Eher unsicher",
                            "value": "2"
                        },
                        {
                            "title": "Mittel",
                            "value": "3"
                        },
                        {
                            "title": "Eher sicher",
                            "value": "4"
                        },
                        {
                            "title": "Sehr sicher",
                            "value": "5"
                        }
                    ],
                    "isMultiSelect": false,
                    "wrap": true
                }
            ]
        },
        {
            "type": "Container",
            "style": "emphasis",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "Vektoren",
                    "weight": "Bolder"
                },
                {
                    "type": "Input.ChoiceSet",
                    "id": "ans_Vektoren_Definition",
                    "style": "expanded",
                    "label": "Ich kenne die Definition des Begriffes Vektor und kann den Unterschied zu Pfeilen erklären. ",
                    "choices": [
                        {
                            "title": "Sehr unsicher",
                            "value": "1"
                        },
                        {
                            "title": "Eher unsicher",
                            "value": "2"
                        },
                        {
                            "title": "Mittel",
                            "value": "3"
                        },
                        {
                            "title": "Eher sicher",
                            "value": "4"
                        },
                        {
                            "title": "Sehr sicher",
                            "value": "5"
                        }
                    ],
                    "isMultiSelect": false,
                    "wrap": true
                },

 

I put this into the adaptive card with the expression. Topic.karte is the name of the output variable of the flow. It has the string Version of the code above. And it seems to work, because I can see the adaptive card in the chat.

 

JSON(ParseJSON(Topic.karte))

 

But now I have no clue how I can get the answers of the self assessment. I created an output:

 

kind: Record
properties:
  Output:
    type:
      kind: Record

 

Now I created a message with the expression: 

 

JSON(Topic.Output)

 

The message I get is zero. So my conclusion is that it doesn't safe the output correctly. But I have no clue how to fix it or where the actual problem is. So I would be really thankful for any help or advice or some link where I can get some help. 

 

And if I did something really stupid, please be gentle to me, I'm just a teacher :D 

 

Best regards

No RepliesBe the first to reply

Resources