On Teams, Images not being displayed under accordion in adaptive card

Copper Contributor

I have Power Virtual Agent bot running on Teams. Images are not being displayed(rather displayed as hyperlinks) under accordion in adaptive card. Same content displays images if it is rendered through simple message.

 

Content containing image rendered through accordion,

 

Karunakaran_GN_1-1689925268985.png

 

 

Content containing images rendered through simple message,

 

Karunakaran_GN_2-1689925317769.png

 

 

Adaptive card JSON with accordion is as below,

 

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "Container",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Headline 1",
                                    "wrap": true,
                                    "size": "Medium"
                                }
                            ],
                            "width": "stretch"
                        },
                        {
                            "type": "Column",
                            "id": "chevronDown1",
                            "spacing": "Small",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "https://adaptivecards.io/content/down.png",
                                    "width": "20px",
                                    "altText": "collapsed"
                                }
                            ],
                            "width": "auto",
                            "isVisible": false
                        },
                        {
                            "type": "Column",
                            "id": "chevronUp1",
                            "spacing": "Small",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "https://adaptivecards.io/content/up.png",
                                    "width": "20px",
                                    "altText": "expanded"
                                }
                            ],
                            "width": "auto"
                        }
                    ],
                    "selectAction": {
                        "type": "Action.ToggleVisibility",
                        "targetElements": [
                            "cardContent1",
                            "chevronUp1",
                            "chevronDown1"
                        ]
                    }
                },
                {
                    "type": "Container",
                    "id": "cardContent1",
                    "items": [
                        {
                            "type": "Container",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Content for headline 1 [View Article](https://kdusdemo2.service-now.com/kb_view.do?sys_kb_id=576e28a387f83c10c71db3c2debb3516) \n\n### Introduction\n\nA pivot table is a table of grouped values that aggregates the individual items of a more extensive table within one or more discrete categories.\n\n### Instructions\n\n## How to create a PivotTable in Excel for Windows\n\n1.  Select the cells you want to create a PivotTable from.\n\n    1.  **Note:**  Your data shouldn't have any empty rows or columns. It must have only a single-row heading.\n2.  Select **Insert** > **PivotTable**.\n3.  ![Pivot Table](https://support.content.office.net/en-us/media/d9736d3a-65b2-40d4-8715-3c814bdf464b.png)\n4.  Under **Choose the data that you want to analyze**, select **Select a table or range**. \n5.  ![Pivot Table](https://support.content.office.net/en-us/media/04bea9cf-04a3-403d-8a37-793241c177d2.png)\n6.  In **Table/Range**, verify the cell range.\n7.  Under **Choose where you want the PivotTable report to be placed**, select **New worksheet** to place the PivotTable in a new worksheet or **Existing worksheet** and then select the location you want the PivotTable to appear.\n8.  Select **OK**.",
                                    "isSubtle": true,
                                    "wrap": true
                                }
                            ]
                        }
                    ]
                }
            ],
            "separator": true,
            "spacing": "Medium"
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Headline 2",
                                    "wrap": true,
                                    "size": "Medium"
                                }
                            ],
                            "width": "stretch"
                        },
                        {
                            "type": "Column",
                            "id": "chevronDown2",
                            "spacing": "Small",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "https://adaptivecards.io/content/down.png",
                                    "width": "20px",
                                    "altText": "collapsed"
                                }
                            ],
                            "width": "auto"
                        },
                        {
                            "type": "Column",
                            "id": "chevronUp2",
                            "isVisible": false,
                            "spacing": "Small",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "https://adaptivecards.io/content/up.png",
                                    "width": "20px",
                                    "altText": "expanded"
                                }
                            ],
                            "width": "auto"
                        }
                    ],
                    "selectAction": {
                        "type": "Action.ToggleVisibility",
                        "targetElements": [
                            "cardContent2",
                            "chevronUp2",
                            "chevronDown2"
                        ]
                    }
                },
                {
                    "type": "Container",
                    "id": "cardContent2",
                    "isVisible": false,
                    "items": [
                        {
                            "type": "Container",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Content for headline 2",
                                    "isSubtle": true,
                                    "wrap": true
                                }
                            ]
                        }
                    ]
                }
            ],
            "separator": true,
            "spacing": "Medium"
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Headline 3",
                                    "wrap": true,
                                    "size": "Medium"
                                }
                            ],
                            "width": "stretch"
                        },
                        {
                            "type": "Column",
                            "id": "chevronDown3",
                            "spacing": "Small",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "https://adaptivecards.io/content/down.png",
                                    "width": "20px",
                                    "altText": "collapsed"
                                }
                            ],
                            "width": "auto"
                        },
                        {
                            "type": "Column",
                            "id": "chevronUp3",
                            "isVisible": false,
                            "spacing": "Small",
                            "verticalContentAlignment": "Center",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "https://adaptivecards.io/content/up.png",
                                    "width": "20px",
                                    "altText": "expanded"
                                }
                            ],
                            "width": "auto"
                        }
                    ],
                    "selectAction": {
                        "type": "Action.ToggleVisibility",
                        "targetElements": [
                            "cardContent3",
                            "chevronUp3",
                            "chevronDown3"
                        ]
                    }
                },
                {
                    "type": "Container",
                    "id": "cardContent3",
                    "isVisible": false,
                    "items": [
                        {
                            "type": "Container",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Content for headline 3",
                                    "isSubtle": true,
                                    "wrap": true
                                }
                            ]
                        }
                    ]
                }
            ],
            "separator": true,
            "spacing": "Medium"
        }
    ],
    "version": "1.3",
    "fallbackText": "This card requires Adaptive Cards v1.2 support to be rendered properly."
}
7 Replies
Thank you for reporting this, we will check this and get back to you.

Thanks Meghana. Also some of the Markup syntaxes not working, like ###. Same can be observed in the screenshot provided above.

@Karunakaran_GN - Please note that the format you are using " ![Pivot Table](https://support.content.office.net/en-us/media/d9736d3a-65b2-40d4-8715-3c814bdf464b.png) " as hyperlink, hence it is rendered as hyperlink in the card.

 

  1. Please use Image type to display images in adaptive cards - Schema Explorer | Adaptive Cards
  2. Please check this doc for the supported markdown in adaptive cards - Text formatting in cards - Teams | Microsoft Learn

 

Thanks, 

Meghana

---------------------------------------------------------------------------------------------------------- 

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 

@Meghana-MSFT Thanks for the response.

I understand []() is the format for hyperlink but, I have used ![]() for mat for images. Same format renderes image on Teams if the content is rendered pa part of simple message but interprets as hyperlink when rendred through adaptive card. Same can be observed in the above screenshots. Content used in both the screenshot is same and both are taken from Teams.

Same case with interpretation of ### or ##, it doesnt work only on adaptiv card. 

 

I request for a quick call to demonstrate it better.

 

Thanks

@Karunakaran_GN - To send images in adaptive card, Please use Image type to display images in adaptive cards - Schema Explorer | Adaptive Cards.

 

Only the markdown mentioned in this doc Text formatting in cards - Teams | Microsoft Learn are supported in adaptive cards. 

 

Please note that only documented ways are supported. 

 

Thanks, 

Meghana

----------------------------------------------------------------------------------------------------

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your

feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 

I cannot use Image type as the conetnt is not structured, is there any other alternate or workaround in such case.

Content:

"Content for headline 1 [View Article](https://kdusdemo2.service-now.com/kb_view.do?sys_kb_id=576e28a387f83c10c71db3c2debb3516) \n\n### Introduction\n\nA pivot table is a table of grouped values that aggregates the individual items of a more extensive table within one or more discrete categories.\n\n### Instructions\n\n## How to create a PivotTable in Excel for Windows\n\n1. Select the cells you want to create a PivotTable from.\n\n 1. **Note:** Your data shouldn't have any empty rows or columns. It must have only a single-row heading.\n2. Select **Insert** > **PivotTable**.\n3. ![Pivot Table](https://support.content.office.net/en-us/media/d9736d3a-65b2-40d4-8715-3c814bdf464b.png)\n4. Under **Choose the data that you want to analyze**, select **Select a table or range**. \n5. ![Pivot Table](https://support.content.office.net/en-us/media/04bea9cf-04a3-403d-8a37-793241c177d2.png)\n6. In **Table/Range**, verify the cell range.\n7. Under **Choose where you want the PivotTable report to be placed**, select **New worksheet** to place the PivotTable in a new worksheet or **Existing worksheet** and then select the location you want the PivotTable to appear.\n8. Select **OK**."

@Karunakaran_GN - No, there is no workaround available currently.

 

 

Thanks, 

Meghana

---------------------------------------------------------------------------------------------------------- 

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.