Hi There,
I have a child flow that produces a string value based on the outcome of a loop that checks for data consistency across multiple tables and returns that string looking a bit like this :
{ "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "text": "C0007 / AoG", "weight": "Bolder" } ], "width": "135px" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Was : " } ], "width": "80px", "spacing": "none" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "" } ], "width": "stretch", "spacing": "none" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Now : " } ], "width": "80px" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "", "width": "stretch" } ], "width": "stretch" } ] },{ "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "text": "Margin %", "weight": "Bolder" } ], "width": "135px" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Was : " } ], "width": "80px", "spacing": "none" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "9.45" } ], "width": "stretch", "spacing": "none" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Now : " } ], "width": "80px" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "9.4526422537", "width": "stretch" } ], "width": "stretch" } ] }
As you can see, this is essentially a JSON object that I want to then inject into an Adaptive Card (Teams), but Power Automate doesn't like Strings for this (complains that it's not JSON), so I've been using the json() expression to convert the string to a JSON object. So far so good. The challenge now is that when I do this (the json() expression) - only the first JSON 'node' is returned, so this bit :
{ "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "text": "C0007 / AoG", "weight": "Bolder" } ], "width": "135px" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Was : " } ], "width": "80px", "spacing": "none" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "" } ], "width": "stretch", "spacing": "none" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Now : " } ], "width": "80px" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "", "width": "stretch" } ], "width": "stretch" } ] },{ "type": "ColumnSet", "columns": [ { "type": "Column", "items": [ { "type": "TextBlock", "text": "Margin %", "weight": "Bolder" } ], "width": "135px" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Was : " } ], "width": "80px", "spacing": "none" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "9.45" } ], "width": "stretch", "spacing": "none" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "Now : " } ], "width": "80px" }, { "type": "Column", "items": [ { "type": "TextBlock", "text": "9.4526422537", "width": "stretch" } ], "width": "stretch" } ] }
The rest appears to be discarded. Is there a way I can get Power Automate to convert the whole JSON object (or objects), or is there maybe a different solution anyone can point me at for this?
Thanks in advance!
Hi Max,
I think I'll add JSONLint to my bookmarks! You were 100% correct - the object was poorly formed. I was heading down a similar line of thought but just couldn't see the break.
Thanks!
Hey there,
the reason it does not work is that the JSON object is malformed and actually ends there. You can test this by putting it into a JSON list: JSONLint - The JSON Validator
If the object is formed correctly, this should not occur.
Hope this helps,
Max
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional