[Skype, Facebook, Nodejs, RichCards]Carousel is not coming up in facebook or skype using the adaptive cards.
Bot Info
- App ID: "e9fa41b0-6cc5-4061-ae70-d09c04db9090"
- SDK Platform: Node.js
- SDK Version:
- Active Channels: Skype, Facebook
- Deployment Environment: ngrok
Issue Description
I'm using one of the JSON Schema for carousel using adaptive cards. https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Cards/1-Schools.JSON
Code Example
https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Cards/1-Schools.JSON
my json:
{"type": "message",
"speak": "Here, are the flight search details......",
"attachmentLayout": "carousel",
"text": "Search Details:",
"attachments": [
{
'contentType': 'application/vnd.microsoft.card.adaptive',
'content': {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0",
"type": "AdaptiveCard",
"speak": "Here, are the flight search details......",
"body": [
{
"type": "TextBlock",
"text": "Search",
"weight": "bolder",
"isSubtle": false
},
{
"type": "TextBlock",
"text": "Details",
"weight": "bolder",
"isSubtle": false
},
{
"type": "ColumnSet",
"separator": true,
"columns": [
{
"type": "Column",
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "Departure: Fri, Dec 8",
"weight": "bolder",
"isSubtle": true
},
{
"type": "TextBlock",
"text": "Amsterdam",
"isSubtle": true
},
{
"type": "TextBlock",
"size": "extraLarge",
"color": "accent",
"text": "AMS",
"spacing": "none"
},
{
"type": "TextBlock",
"text": "6:00 AM",
"isSubtle": true,
"spacing": "none"
},
{
"type": "TextBlock",
"size": "Large",
"color": "accent",
"text": "#",
"spacing": "none"
},
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": " ",
"seperator": true
},
{
"type": "Image",
"url": "http://messagecardplayground.azurewebsites.net/assets/airplane.png",
"size": "small",
"spacing": "none",
"seperator": true
}
]
},
{
"type": "Column",
"width": 1,
"items": [ {
"type": "TextBlock",
"horizontalAlignment": "right",
"text": "Arrival",
"weight": "bolder",
"separator": true,
"isSubtle": true
},
{
"type": "TextBlock",
"horizontalAlignment": "right",
"text": "San Francisco",
"isSubtle": true
},
{
"type": "TextBlock",
"horizontalAlignment": "right",
"size": "extraLarge",
"color": "accent",
"text": "SFO",
"spacing": "none"
},
{
"type": "TextBlock",
"text": "6:00 AM",
"isSubtle": true,
"horizontalAlignment": "right",
"spacing": "none"
},
{
"type": "TextBlock",
"size": "Large",
"color": "accent",
"text": "fare",
"horizontalAlignment": "right",
"spacing": "none"
},
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Book",
"data": {"address":"text"}
},
{
"type": "Action.OpenUrl",
"title": "Details",
"url":"http://localhost:3978/flightdetails",
"seperator": true
}
]
}
},
{
'contentType': 'application/vnd.microsoft.card.adaptive',
'content': {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0",
"type": "AdaptiveCard",
"speak": "Here, are the flight search details......",
"body": [
{
"type": "TextBlock",
"text": "Search",
"weight": "bolder",
"isSubtle": false
},
{
"type": "TextBlock",
"text": "Details",
"weight": "bolder",
"isSubtle": false
},
{
"type": "ColumnSet",
"separator": true,
"columns": [
{
"type": "Column",
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "Departure: Fri, Dec 8",
"weight": "bolder",
"isSubtle": true
},
{
"type": "TextBlock",
"text": "Amsterdam",
"isSubtle": true
},
{
"type": "TextBlock",
"size": "extraLarge",
"color": "accent",
"text": "AMS",
"spacing": "none"
},
{
"type": "TextBlock",
"text": "6:00 AM",
"isSubtle": true,
"spacing": "none"
},
{
"type": "TextBlock",
"size": "Large",
"color": "accent",
"text": "#",
"spacing": "none"
},
]
},
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": " ",
"seperator": true
},
{
"type": "Image",
"url": "http://messagecardplayground.azurewebsites.net/assets/airplane.png",
"size": "small",
"spacing": "none",
"seperator": true
}
]
},
{
"type": "Column",
"width": 1,
"items": [ {
"type": "TextBlock",
"horizontalAlignment": "right",
"text": "Arrival",
"weight": "bolder",
"separator": true,
"isSubtle": true
},
{
"type": "TextBlock",
"horizontalAlignment": "right",
"text": "San Francisco",
"isSubtle": true
},
{
"type": "TextBlock",
"horizontalAlignment": "right",
"size": "extraLarge",
"color": "accent",
"text": "SFO",
"spacing": "none"
},
{
"type": "TextBlock",
"text": "6:00 AM",
"isSubtle": true,
"horizontalAlignment": "right",
"spacing": "none"
},
{
"type": "TextBlock",
"size": "Large",
"color": "accent",
"text": "fare",
"horizontalAlignment": "right",
"spacing": "none"
},
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Book",
"data": {"address":"text"}
},
{
"type": "Action.OpenUrl",
"title": "Details",
"url":"http://localhost:3978/flightdetails",
"seperator": true
}
]
}
}]}
var cardSchema = "Json taken from the url and changed it to according to my requirement" session.send(cardSchema);
I have used the botbuilder carousel syntax even that has not worked.
In skype, it is just coming as one card and buttons are also not working.
Reproduction Steps
1. 2. 3.
Expected Behavior
Carousel should be coming up in facebook as in channel inspector it shows adaptive cards are supported in facebook.
Actual Results
Instead of coming us as carousel, cards are coming up in rows one after the other. https://docs.botframework.com/en-us/channel-inspector/channels/Facebook?f=AdaptiveCards&e=example1
When I entered your JSON into the adaptive cards visualizer, it appears the JSON is not well formed. Try it for yourself and see if you can get it working in there I noticed you were using ' instead of " in some places
If you see any of the json schema examples provided https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Cards/ for contoso scuba bot none of them are coming up in http://adaptivecards.io/visualizer/.But when i use the same json in node js I'm getting them as rows. scuba bot example schemas: 1.{ "type": "message", "speak": "Hi! I'm Contoso Dive Finder!I'll help you schedule a scuba getaway!", "text": "Hi! I'm Contoso Dive Finder!\n\nI'll help you schedule a scuba getaway!", "attachments": [ { "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "body": [ { "type": "ColumnSet", "columns": [ { "type": "Column", "size": "auto", "items": [ { "type": "Image", "size": "medium", "url": "http://contososcuba.azurewebsites.net/assets/Contoso_logo.jpg" } ] }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Start with something like:", "size": "large", "weight": "bolder" }, { "type": "TextBlock", "text": "'Where can I go scuba diving?'", "separation": "none" }, { "type": "TextBlock", "text": "or", "separation": "none" }, { "type": "TextBlock", "text": "'Show me some local wildlife.'", "separation": "none" }, { "type": "TextBlock", "text": "You can also 'restart' anytime.", "separation": "none" } ] } ] } ] } } ] } 2.{ "type": "message", "inputHint": "expectingInput", "speak": "Good afternoon! Please take a look at the great scuba schools nearby. Margie's Travel, Fabrikam, Adventure Works, or Relecloud Diving", "text": "Good afternoon! Please take a look at the great scuba schools nearby.", "attachmentLayout": "carousel", "attachments": [ { "contentType": "application/vnd.microsoft.card.adaptive", "content": { "type": "AdaptiveCard", "body": [ { "type": "ColumnSet", "columns": [ { "type": "Column", "size": "auto", "items": [ { "type": "ColumnSet", "columns": [ { "type": "Column", "size": "auto", "items": [ { "type": "Image", "size": "large", "url": "https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Assets/dolphin-203875_640.jpg?raw=true" } ] }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Margie's Travel", "size": "large", "weight": "bolder" }, { "type": "TextBlock", "text": "4.4 stars", "separation": "none" } ] } ] }, { "type": "TextBlock", "text": "42 miles away", "weight": "bolder" }, { "type": "TextBlock", "text": "1602 E Avenue Rd.", "separation": "none" }, { "type": "TextBlock", "text": "Gig Harbor, WA 98335", "separation": "none" } ] }, { "type": "Column", "size": "auto", "items": [ { "type": "Image", "size": "medium", "url": "https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Assets/MargiesTravel2.png?raw=true" } ]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "This one",
"data": {
"school": "Margie's Travel"
}
}
]
}
},
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "Image",
"size": "large",
"url": "https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Assets/scuba-diver-1237237_640.jpg?raw=true"
}
]
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "Fabrikam",
"size": "large",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "4.1 stars",
"separation": "none"
}
]
}
]
},
{
"type": "TextBlock",
"text": "13 miles away",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "217 W Pine St.",
"separation": "none"
},
{
"type": "TextBlock",
"text": "Seattle, WA 98126",
"separation": "none"
}
]
},
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "Image",
"size": "medium",
"url": "https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Assets/FabrikamLogo2.png?raw=true"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "This one",
"data": {
"school": "Fabrikam"
}
}
]
}
},
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "Image",
"size": "large",
"url": "https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Assets/loggerhead-turtle-123402_640.jpg?raw=true"
}
]
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "Adventure Works",
"size": "large",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "3.2 stars",
"separation": "none"
}
]
}
]
},
{
"type": "TextBlock",
"text": "7 miles away",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "510 N Yale Ave.",
"separation": "none"
},
{
"type": "TextBlock",
"text": "Seattle, WA 98127",
"separation": "none"
}
]
},
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "Image",
"size": "medium",
"url": "https://github.com/matthidinger/ContosoScubaBot/blob/master/ContosoScuba.Bot/Assets/AdventureWorksLogo2.png?raw=true"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "This one",
"data": {
"school": "Adventure Works"
}
}
]
}
},
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "Image",
"size": "large",
"url": "http://adaptivecards-staging.azurewebsites.net/content/Relecloud.png"
}
]
},
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"text": "Relecloud Diving",
"size": "large",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "4.7 stars",
"separation": "none"
}
]
}
]
},
{
"type": "TextBlock",
"text": "15 miles away",
"weight": "bolder"
},
{
"type": "TextBlock",
"text": "1210 W Hanford St.",
"separation": "none"
},
{
"type": "TextBlock",
"text": "Seattle, WA 98105",
"separation": "none"
}
],
"actions": [
{
"type": "Action.Submit",
"title": "This one",
"data": {
"school": "Relecloud Diving"
}
}
]
}
}
] }
First example is just one card and second example is cards. My json is also similar to this even they are not coming up in adaptivecards visualiser.
@jagadeeshmarthy Is the carousel working as expected in ms-teams ?