cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ksksn
New Member

Post_your_own_adaptive_card_as_the_Flow_bot_to_a_channel failing with error Http request failed: the content was not a valid JSON

Hi,

I have a created a flow to post an adaptive card to Teams. I have created a sample schema to test my template. It is failing with the error as invalid JSON. The sample JSON is given below fails only when the container containing column set items(ADF and Status) has 15 or more items. Till 14 items the flow works fine. Is there a max length to the JSON that can be put in flow??

This is my flow:

Ksksn_0-1598406479545.png

 

Sample JSON:

{
    "type": "AdaptiveCard",
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.2",
    "body": [
        {
            "type": "Container",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "Daily Handover: 8/26/2020 3:44 AM",
                    "size": "large",
                    "weight": "bolder"
                }
            ]
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "Tabular Status",
                    "size": "large",
                    "weight": "bolder"
                }
            ]
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Tabular Name",
                                    "size": "large",
                                    "weight": "bolder"
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "size": "large",
                                    "weight": "bolder"
                                }
                            ]
                        }
                    ],
                    "style": "emphasis"
                }
            ]
        },
        {
            "type": "Container",
            "spacing": "Small",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Tabular Name",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Tabular Name",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Tabular Name",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Tabular Name",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                }
            ]
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "ADF Status",
                    "weight": "bolder",
                    "size": "large"
                }
            ],
            "style": "default"
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Stream Name",
                                    "size": "large",
                                    "weight": "bolder"
                                }
                            ]
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "size": "large",
                                    "weight": "bolder"
                                }
                            ]
                        }
                    ],
                    "style": "emphasis"
                }
            ]
        },
        {
            "type": "Container",
            "spacing": "Small",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "ADF",
                                    "horizontalAlignment": "Center",
                                    "wrap": true
                                }
                            ],
                            "style": "accent"
                        },
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "text": "Status",
                                    "horizontalAlignment": "Center"
                                }
                            ],
                            "style": "attention",
                            "spacing": "Small"
                        }
                    ]
                }
            ]
        }
    ]
}

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @Ksksn,

 

There is a known limit is The message size limit for the "Post a message" action is approximately 28KB. This encompasses all HTML elements like text, images, links, tables, mentions, and so on. If the message exceeds 28KB the action will fail with an error stating: "Request Entity too large", not "the content was not a valid JSON". But I assume that's the problem.

https://docs.microsoft.com/en-us/connectors/teams/#known-issues-and-limitations

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
v-litu-msft
Community Support
Community Support

Hi @Ksksn,

 

There is a known limit is The message size limit for the "Post a message" action is approximately 28KB. This encompasses all HTML elements like text, images, links, tables, mentions, and so on. If the message exceeds 28KB the action will fail with an error stating: "Request Entity too large", not "the content was not a valid JSON". But I assume that's the problem.

https://docs.microsoft.com/en-us/connectors/teams/#known-issues-and-limitations

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Hi @v-litu-msft 

Thank you for the reply. The issue was due to message size limit. The JSON with whitespace exceeded 28KB. Removing the whitespace from JSON reduced the size.

Was the message size limit a recent change to "Post a message" action? Cause my flow used to work fine with JSON having whitespace up till last month, or maybe the "Post an adaptive card" action used to remove whitespace from JSON implicitly.

v-litu-msft
Community Support
Community Support

Hi @Ksksn,

 

There have been no recent updates on limitations. 

If there are any limitation updates, it will be explained in the document in time to let users know.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,215)