Forum Discussion

sowmyaseetha's avatar
sowmyaseetha
Copper Contributor
Sep 29, 2023
Solved

bot message limitation and alternative for that limitation

hi team,

i have a problem in showing a tabular form which has content of 10 to 15 rows and columns
but in bot there is a limitation of 40KB

(The bot message size limit is 40 KB. If the bot message size limit exceeds 40 KB, bot receives a 413 status code)

what can i do and is there any alternative ?

 
  • sowmyaseetha 

    Yes, you're correct that the bot message size limit is 40 KB. If your message, including the tabular data, exceeds this limit, you will receive a 413 status code (RequestEntityTooLarge).

    Here are a few alternatives you can consider:

    1. Pagination: If your table has too many rows to fit within the size limit, consider implementing pagination. You can send a subset of the data in each message and provide buttons or other interactive elements to navigate between pages.

    2. Adaptive Cards: You can use Adaptive Cards to display tabular data. Adaptive Cards are a platform-agnostic way to present rich, interactive content. They can contain text, images, buttons, and even input forms. However, keep in mind that the total payload of the Adaptive Card must still be within the 40KB limit.

    3. Deep Linking to a Tab: If the data is too large to fit within a bot message, you can consider creating a tab to display the data. You can then send a message with a deep link to this tab. This way, users can click on the link to view the data in a full tab.

    4. External Link: If the data is hosted on an external website, you can simply send a link to that website in your bot message.

    Remember to always optimize your bot messages to ensure an optimal user experience and to prevent your messages from appearing as spam to your users.

    Here's an example of how you can use an Adaptive Card to display tabular data:

    {
        "type": "AdaptiveCard",
        "body": [
            {
                "type": "TextBlock",
                "text": "Your Table Title",
                "weight": "Bolder",
                "size": "Medium"
            },
            {
                "type": "FactSet",
                "facts": [
                    {
                        "title": "Column 1:",
                        "value": "Row 1 Data"
                    },
                    {
                        "title": "Column 2:",
                        "value": "Row 1 Data"
                    },
                    // Add more rows as needed
                ]
            }
        ],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.2"
    }
    

    In this example, we're using a FactSet to display tabular data. Each Fact represents a row in the table. The title is the column name and the value is the data in that row for that column. You can add as many Fact objects as you need to represent your data.

    For more information on Adaptive Cards, you can refer to the Adaptive Cards documentation.

    Thanks,
    Nivedipa
    -------------------------------------------------------------------------
    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.

4 Replies

  • sowmyaseetha 

    Yes, you're correct that the bot message size limit is 40 KB. If your message, including the tabular data, exceeds this limit, you will receive a 413 status code (RequestEntityTooLarge).

    Here are a few alternatives you can consider:

    1. Pagination: If your table has too many rows to fit within the size limit, consider implementing pagination. You can send a subset of the data in each message and provide buttons or other interactive elements to navigate between pages.

    2. Adaptive Cards: You can use Adaptive Cards to display tabular data. Adaptive Cards are a platform-agnostic way to present rich, interactive content. They can contain text, images, buttons, and even input forms. However, keep in mind that the total payload of the Adaptive Card must still be within the 40KB limit.

    3. Deep Linking to a Tab: If the data is too large to fit within a bot message, you can consider creating a tab to display the data. You can then send a message with a deep link to this tab. This way, users can click on the link to view the data in a full tab.

    4. External Link: If the data is hosted on an external website, you can simply send a link to that website in your bot message.

    Remember to always optimize your bot messages to ensure an optimal user experience and to prevent your messages from appearing as spam to your users.

    Here's an example of how you can use an Adaptive Card to display tabular data:

    {
        "type": "AdaptiveCard",
        "body": [
            {
                "type": "TextBlock",
                "text": "Your Table Title",
                "weight": "Bolder",
                "size": "Medium"
            },
            {
                "type": "FactSet",
                "facts": [
                    {
                        "title": "Column 1:",
                        "value": "Row 1 Data"
                    },
                    {
                        "title": "Column 2:",
                        "value": "Row 1 Data"
                    },
                    // Add more rows as needed
                ]
            }
        ],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.2"
    }
    

    In this example, we're using a FactSet to display tabular data. Each Fact represents a row in the table. The title is the column name and the value is the data in that row for that column. You can add as many Fact objects as you need to represent your data.

    For more information on Adaptive Cards, you can refer to the Adaptive Cards documentation.

    Thanks,
    Nivedipa
    -------------------------------------------------------------------------
    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.

Resources