microsoft / BotFramework-Emulator

A desktop application that allows users to locally test and debug chat bots built with the Bot Framework SDK.
https://aka.ms/botemulator
MIT License
1.81k stars 754 forks source link

AdaptiveCard does not display #2274

Closed worldwidemartin closed 3 years ago

worldwidemartin commented 3 years ago

I have an adaptiveCard template and data set which renders correctly in the Designer, but not in the emulator.

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.2",
    "body": [
        {
            "type": "Container",
            "$data": "${$root.categories}",
            "items": [
                {
                    "type": "Container",
                    "items": [
                        {
                            "type": "Container",
                            "style": "good",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "${description}",
                                    "wrap": true,
                                    "spacing": "Medium",
                                    "horizontalAlignment": "Center",
                                    "weight": "Bolder"
                                }
                            ]
                        },
                        {
                            "type": "Input.ChoiceSet",
                            "id": "${categoryid}",
                            "isMultiSelect": true,
                            "wrap": true,
                            "$data": "${interests}",
                            "choices": [
                                {
                                    "title": "${description}",
                                    "value": "${interestid}"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ],
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Submit"
        }
    ]
}

DataJSON:
{
  "categories": [
    {
      "categoryID": 1,
      "description": "Career &  Business",
      "priority": 0,
      "interests": [
        {
          "interestID": 2,
          "description": "Entrepreneurship",
          "priority": 0
        },
        {
          "interestID": 3,
          "description": "Investing",
          "priority": 0
        },
        {
          "interestID": 4,
          "description": "Event Planning & Hospitality",
          "priority": 0
        },
        {
          "interestID": 5,
          "description": "Marketing & Advertising",
          "priority": 0
        },
        {
          "interestID": 6,
          "description": "Real Estate",
          "priority": 0
        }
      ]
    },
    {
      "categoryID": 7,
      "description": "Entertainment & Media",
      "priority": 0,
      "interests": [
        {
          "interestID": 8,
          "description": "Friends",
          "priority": 0
        },
        {
          "interestID": 9,
          "description": "Game of Thrones",
          "priority": 0
        },
        {
          "interestID": 10,
          "description": "Harry Potter",
          "priority": 0
        },
        {
          "interestID": 11,
          "description": "Middle Earth Saga",
          "priority": 0
        },
        {
          "interestID": 12,
          "description": "Star Wars",
          "priority": 0
        },
        {
          "interestID": 13,
          "description": "Marvel Cinematic Universe",
          "priority": 0
        }
      ]
    },
    {
      "categoryID": 14,
      "description": "Outdoors",
      "priority": 0,
      "interests": [
        {
          "interestID": 15,
          "description": "Cycling",
          "priority": 0
        },
        {
          "interestID": 16,
          "description": "Mountain Biking",
          "priority": 0
        },
        {
          "interestID": 17,
          "description": "Hiking",
          "priority": 0
        },
        {
          "interestID": 18,
          "description": "Camping",
          "priority": 0
        },
        {
          "interestID": 19,
          "description": "Hunting",
          "priority": 0
        },
        {
          "interestID": 20,
          "description": "Climbing",
          "priority": 0
        },
        {
          "interestID": 21,
          "description": "Winter Sports",
          "priority": 0
        },
        {
          "interestID": 23,
          "description": "Road Cycling",
          "priority": 0
        }
      ]
    },
    {
      "categoryID": 22,
      "description": "Science & Technology",
      "priority": 0,
      "interests": [
        {
          "interestID": 24,
          "description": "AI & Machine Learning",
          "priority": 0
        },
        {
          "interestID": 25,
          "description": "Robotics",
          "priority": 0
        },
        {
          "interestID": 26,
          "description": "IoT",
          "priority": 0
        },
        {
          "interestID": 27,
          "description": "Aerospace",
          "priority": 0
        },
        {
          "interestID": 28,
          "description": "Renewable Energy",
          "priority": 0
        },
        {
          "interestID": 29,
          "description": "Virtual Reality",
          "priority": 0
        }
      ]
    },
    {
      "categoryID": 30,
      "description": "Sports",
      "priority": 0,
      "interests": [
        {
          "interestID": 31,
          "description": "Baseball",
          "priority": 0
        },
        {
          "interestID": 32,
          "description": "Golf",
          "priority": 0
        },
        {
          "interestID": 33,
          "description": "Basketball",
          "priority": 0
        },
        {
          "interestID": 34,
          "description": "Soccer",
          "priority": 0
        },
        {
          "interestID": 35,
          "description": "Football",
          "priority": 0
        },
        {
          "interestID": 36,
          "description": "Tennis",
          "priority": 0
        }
      ]
    }
  ]
}

Any ideas? Thanks

anusharr commented 3 years ago

@worldwidemartin, can you attach screenshots of how the card is rendering in Designer and on the Emulator? Also, are you making use of any specific sample or implementing your own code? Let me try the above template on my end. What version of the Emulator are you testing this on?

worldwidemartin commented 3 years ago

Hi,

Thanks for getting back to me!

I figured out the issue – the IDs of some of my Input.Toggle elements were being serialised as integers, not strings. It seems the designer can handle this but the emulator cannot…

Bizzare…

Many thanks Martin

From: anusharavindrar @.> Sent: 07 July 2021 23:11 To: microsoft/BotFramework-Emulator @.> Cc: worldwidemartin @.>; Mention @.> Subject: Re: [microsoft/BotFramework-Emulator] AdaptiveCard does not display (#2274)

@worldwidemartinhttps://github.com/worldwidemartin, can you attach screenshots of how the card is rendering in Designer and on the Emulator? Also, are you making use of any specific sample or implementing your own code? Let me try the above template on my end. What version of the Emulator are you testing this on?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/microsoft/BotFramework-Emulator/issues/2274#issuecomment-875967651, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIITITA5D3BIU2QYSYWW35DTWTGFRANCNFSM472STZUQ.

axelsrz commented 3 years ago

I'm clodsing due per last comment on this thread. If problem persist open a new issue.