1
votes

I am trying to create an adaptive card with a fact set. However, I can't seem to get the actual facts to display. Even the example at https://adaptivecards.io/designer/ is not working. Instead of pulling in the data from the properties element as specified, it just shows ${key} and ${value} as the pair. You can see the output and the full JSON at the link above, but here are the relevant sections for my issue/query:

Adaptive card specification

       {
            "type": "FactSet",
            "facts": [
                {
                    "$data": "${properties}",
                    "title": "${key}:",
                    "value": "${value}"
                }
            ]
        }

Data object

    "properties": [
        {
            "key": "Board",
            "value": "Adaptive Cards"
        },
        {
            "key": "List",
            "value": "Backlog"
        },
        {
            "key": "Assigned to",
            "value": "Matt Hidinger"
        },
        {
            "key": "Due date",
            "value": "Not set"
        }
    ]
1
In which channel is this? Not every channel supports adaptive cards. - Kris van der Mast
All channels. Check the designer site. You can change the channel. None of them display the facts. I think something has changed and the specification is not up to date. - billoverton
Your example there works fine in the designer, you just have to make sure to use the "Preview" button when working in the web designer. Array binding only shows properly when preview mode is active. Alternatively you can use marketplace.visualstudio.com/… which shows array bound elements always. - Tim Cadenbach
Well that was simple. I hadn't put it into my bot yet because I didn't want to spend time changing the current output if it didn't work. If you put this comment as an answer I'll accept it. I'm sure I won't be the last person not to know about Preview Mode. - billoverton
Yea, I'll probably talk to the guys about that. You're not the first person with that question and surely not the last. The Preview button is pretty prominent but people don't really know what it does. - Tim Cadenbach

1 Answers

2
votes

As this or similar questions came up multiple times recently. You have to make sure to use the "Preview" button

enter image description here

Elements bound to any array in JSON are not rendered during design time or only when the specific array element is referenced with array[x].xx. Dynamically generated elements currently are only rendered in preview mode when working in the web editor version https://adaptivecards.io/designer

If you need a design time experience for array bound elements you can use Adaptive Cards Studio the Visual Studio Code Extension for card authoring.