cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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.

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (42,807)