microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
868 stars 372 forks source link

Array of objects data binding is not working composer Adaptive card, But working in Online Adaptive card designer!! #9723

Open midhunkalathilapipeople opened 6 months ago

midhunkalathilapipeople commented 6 months ago

I have below Json data that work in online adaptive card designer but the same code is not working in composer, Can anybody help on this?

Composer version: 2.1.3-nightly.364675.1a93f21 OS : Windows Framework: .NET

Below shared the Json data and AdaptiveCard jsonData:

`{ "code": "ER-13052", "expenses": [ {

  "date": "2017-02-21",
  "description": "Air Travel Expense",
  "total": 300,      
  "created_time": "2019-06-19T18:33:12+0800"
},
{
  "date": "2019-06-19",
  "description": "Auto Mobile Expense",
  "total": 100,
  "created_time": "2019-06-19T18:33:12+0800"
},
{
  "date": "2019-06-21",
  "description": "Excess Baggage Cost",
  "total": 50.38,
  "created_time": "2019-06-21T18:33:12+0800"
}

] }`

AdaptiveCard:

{ "type": "AdaptiveCard", "body": [ { "type": "Container", "spacing": "Large", "style": "emphasis", "items": [ { "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "weight": "Bolder", "text": "DATE", "wrap": true } ], "width": "auto" }, { "type": "Column", "spacing": "Large", "items": [ { "type": "TextBlock", "weight": "Bolder", "text": "CATEGORY", "wrap": true } ], "width": "stretch" }, { "type": "Column", "items": [ { "type": "TextBlock", "weight": "Bolder", "text": "AMOUNT", "wrap": true } ], "width": "auto" } ] } ], "bleed": true }, { "$data": "${expenses}", "type": "Container", "items": [ { "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "text": "${formatDateTime(created_time, 'MM-dd')}", "wrap": true } ], "width": "auto" }, { "type": "Column", "spacing": "Medium", "items": [ { "type": "TextBlock", "text": "${description}", "wrap": true } ], "width": "stretch" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "$${formatNumber(total, 2)}", "wrap": true } ], "width": "auto" } ] } ] } ], "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "version": "1.5", "fallbackText": "This card requires Adaptive Cards v1.5 support to be rendered properly." }

Working screenshot on Online :

image

Error : The card is not showing in Emulator/Web Chat image

Please suggest what changes will solve this.

Thanks in advance!!

OEvgeny commented 6 months ago

As far as I know neither WebChat nor Composer don't support adaptive cards v. 1.5.

The supported version is v. 1.3.

midhunkalathilapipeople commented 6 months ago

Thank you for the quick support.

Getting same error even we tried with version 1.3.

Are they support array operation in composer ? I searched for some sample bot with the same , Didn't found.

OEvgeny commented 6 months ago

I'm not seeing the support mentioned either. Does the card look the same (missing) after the version downgrade?

midhunkalathilapipeople commented 6 months ago

Hi @OEvgeny Yes. Looks same , Doesn't work.