Forum Discussion

nscharmacher's avatar
nscharmacher
Copper Contributor
Jul 15, 2026

[Adaptive Card] Issue with CodeBlock line numbers and more

I have a simple adaptive card containing a code block with multiline SQL in it:

 

from botbuilder.core import CardFactory, MessageFactory, TurnContext

async def send_sql_card(context: TurnContext):
    SQL_QUERY = """SELECT
            order_date,
            customer_id,
            SUM(quantity * unit_price) AS revenue
        FROM catalog.sales.order_items
        WHERE order_date >= DATE '2026-01-01'
        AND order_date < DATE '2026-06-01'
        GROUP BY
            order_date,
            customer_id
    """

    activity = MessageFactory.attachment(
        attachment=CardFactory.adaptive_card(
            {
                "type": "AdaptiveCard",
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "version": "1.6",
                "msteams": {"width": "full"},
                "body": [
                    {
                        "type": "CodeBlock",
                        "codeSnippet": SQL_QUERY,
                        "language": "sql",
                    },
                ],
            }
        )
    )

    await context.send_activity(activity)
 

This worked fine until maybe a few weeks ago. Now, there are two issues:

Line numbers appear twice:

Not all lines are being shown:

It says "Expand (11 lines)", but it only shows 9.

This happens on Teams Desktop - it looks fine on the web version.

2 Replies

  • Hello nscharmacher, 

    Thank you for bringing this issue to our attention.

    To assist you better, could you please provide the following details? 

    1. Reproduction Steps: Please share the steps you took to encounter the issue. 
    2. Documentation Links: Any specific documentation you followed that relates to your problem. 
    3. Teams Client Version: What version of the Teams client are you using? 
    4. Manifest Package: If applicable, please share the manifest package for your app. 

    This information will help us better understand the situation and provide a more accurate response. 

     

    • nscharmacher's avatar
      nscharmacher
      Copper Contributor

      Hey Sayali-MSFT​.

      My current client version is 26163.405.4842.717. I have already provided a code snippet (which uses the bot framework in python) in the initial post.

      With the facts in mind that it apparently only affects the Teams Desktop client and also retroactively affects Adaptive Cards we've sent half a year ago, I don't think that this is related to our specific implementation, though. It also happened to different people using different Teams bots in different tenants.