Action.ShowCard does not works in selectAction
When an image with a "selectAction" type of "Action.ShowCard" (please see the attached JSON) is clicked, WebChat does not display the card. However, the same functionality does work in the Microsoft Visualizer, which does display the nested card as a popup.
Note: Tried changing the "actionMode" property in adaptivecards-hostconfig.json from its default value of "inlineEdgeToEdge" to "popup", but that didn't help either.
I don't think we currently support ShowCardAction inside selectAction. @danmarshall @eanders-MS can you comment on it?
I traced the code and it reached here.
It should be supported, but it is not implemented yet. It was dependent on a resize event from the Adaptive Card which did not exist at that time. Looks like it has recently been implemented in AdaptiveCards: https://github.com/Microsoft/AdaptiveCards/issues/431 ...so someone can now add the code to listen for this resize event, and resize the WebChat message (and manage the scroll location, etc.)
Or should we show another card below when the user click on ShowCard? Because from the behavioral view, it is actually opening a new dialog.
It should be the same as the Visualizer
If you copy @puripuneet JSON to the visualizer, it looks like this, opening a modal dialog (the background is a bit dimmed).

I have cleaned the JSON so it's for anyone to copy.
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Image",
"url": "http://adaptivecards.io/content/cats/1.png",
"selectAction": {
"type": "Action.ShowCard",
"title": "Action.ShowCard",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text":"What do you think?"
}
],
"actions": [
{
"type":"Action.Submit",
"title":"Neat!"
}
]
}
}
}
]
}
@matthidinger - can you tell us why some Action.ShowCard actions show a modal while others appear inline?
@danmarshall my layman's guess is that when the Action.ShowCard is nested inside an image, it always results in the adaptive card showing as a modal because an image is static and doesn't have "real estate" to resize in order to show the adaptive card inline. Whereas, an adaptive card nested inside another adaptive card can resize and show as inline (but note in this case that the "actionMode" property in adaptivecards-hostconfig.json is what should control whether it shows as inline or modal).
We actually never officially supported ShowCard in a selectAction because we haven't had time to properly vet the experience everywhere and with every known Host so we err'd on the side of caution and didn't support it for 1.0.
The docs here mention that Action.ShowCard is not supported in selectAction today.
http://adaptivecards.io/explorer/Image.html
Hopefully we can look into this in a future release. I haven't seen many requests for it yet, but if you folks are getting feedback that this is an important scenario we can dive in.
I was really hoping for a workaround for this issue. I just have some regular items shown as a list and some items need to have a checkbox or maybe two radiobuttons I like to hide initially, only to be shown if you select an item.. I wanted to prevent a situation where i have to create multiple cards to tackle this.
I would really appreciate if this feature would be allowed as it gives a lot of extra alternatives for developers like myself. At the moment I find myself fighting the adaptive cards to find a workaround for most common UX solutions. I understand its in preview, but it makes it a bit more difficult as you cant work from common expectations.
@mennolaan are you using Adaptive Cards for form-filling + validation?
@compulim Yes and no, the checkboxes are just part of the total information I'm going to send.
Customizable activity bubble is coming.
But if you are more into form-filling/validation, it is coming too. But it's a little bit different. It works by filling the form outside of the Web Chat component, but on the same page. We think this is better than inline form filling because:
- Simple form-filling can be done by Adaptive Cards (without logic)
- Form with logic can be implemented on the web page using HTML5 Validation API, and Web Chat interface with it
- HTML5 Validation API is good because you don't need to worry about localization and accessibility
- You can leverage your existing validation logic (if you have any), i.e. Web Chat help you to fill the existing form
Can you please tell me why adaptive cards is not working for facebook as same is working in Emulator?
And also button list in facebook getting break after count of three?
===> Button for Emulator
===>Button for fb
===>adaptive for Emulator
===>adaptive for fb
@pankajGODB is it Adaptive Cards or a rich card (hero card) for the first one?
Facebook did not adopt Adaptive Cards so you can't use it over there. We do best effort to render as close as we could.
@compulim button designed using hero card and below is the code
`var msg = new builder.Message(session) .attachments([ new builder.HeroCard(session) .title("Space Needle") .subtitle("The Space Needle is an observation tower in Seattle, Washington, a landmark of the Pacific Northwest, and an icon of Seattle.") .buttons([ builder.CardAction.imBack(session, "select:100", "Select"), builder.CardAction.imBack(session, "select:101", "Select1"), builder.CardAction.imBack(session, "select:102", "Select2"), builder.CardAction.imBack(session, "select:103", "Select3"), builder.CardAction.imBack(session, "select:104", "Select4") ]), ]);``
After count of three, button gets spilited in fb. Can you tell me how can i split buttons into column(2 or 3 in one row)?
@pankajGODB see https://docs.botframework.com/en-us/channel-inspector/channels/Facebook?f=HeroCard&e=example1
Closing due to inactivity