I have a flow that retrieves items (an array in JSON) from dataverse. I'm then taking values from each object in the array (apply to each) for use in a compose, then append each new "compostion" to a string variable (seperated by a comma). See below

This works fine and my output shown in the UI is below (in this example there are two objects, both starting with "type" : "ColumnSet")
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"horizontalAlignment": "Left",
"text": "1.",
"wrap": true,
"size": "Medium"
}
],
"width": "auto",
"padding": "None",
"spacing": "None"
},
{
"type": "Column",
"items": [
{
"type": "FactSet",
"id": "9d60e7c6-611b-c2b9-b43e-af37c0154ad6",
"facts": [
{
"title": "StartDate:",
"value": "2022-08-11"
},
{
"title": "EndDate:",
"value": "2022-08-11"
}
]
}
],
"width": "stretch",
"spacing": "Small",
"padding": "None"
},
{
"type": "Column",
"items": [
{
"type": "FactSet",
"id": "274d7b95-17ae-ff6d-fa93-27568cf0fb2c",
"facts": [
{
"title": "Days:",
"value": "1"
}
]
}
],
"width": "stretch",
"spacing": "Small",
"padding": "None"
}
],
"padding": "None"
},{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"type": "TextBlock",
"horizontalAlignment": "Left",
"text": "1.",
"wrap": true,
"size": "Medium"
}
],
"width": "auto",
"padding": "None",
"spacing": "None"
},
{
"type": "Column",
"items": [
{
"type": "FactSet",
"id": "9d60e7c6-611b-c2b9-b43e-af37c0154ad6",
"facts": [
{
"title": "StartDate:",
"value": "2022-08-09"
},
{
"title": "EndDate:",
"value": "2022-08-10"
}
]
}
],
"width": "stretch",
"spacing": "Small",
"padding": "None"
},
{
"type": "Column",
"items": [
{
"type": "FactSet",
"id": "274d7b95-17ae-ff6d-fa93-27568cf0fb2c",
"facts": [
{
"title": "Days:",
"value": "2"
}
]
}
],
"width": "stretch",
"spacing": "Small",
"padding": "None"
}
],
"padding": "None"
}
The problem comes when trying to use this string in a later action. I've used the string in a compose along with some static json

but when the flow is run it returns the string with backslashes all over the place, which is not valid JSON.

I found that using json(mystring) fixed the issue, but it only ever returns the first item in the JSON.
I have tried wrapping the use of the string in replace() to remove the "\" and "\n" but they still appear when I run the flow.
I have also removed all of the carriage returns in the composes, but it still inserts \ everywhere
"{\"type\":\"ColumnSet\",\"columns\":[{\"type\":\"Column\",\"items\":[{\"type\":\"TextBlock\",\"horizontalAlignment\":\"Left\",\"text\":\"1.\",\"wrap\":true,\"size\":\"Medium\"}],\"width\":\"auto\",\"padding\":\"None\",\"spacing\":\"None\"},{\"type\":\"Column\",\"items\":[{\"type\":\"FactSet\",\"id\":\"9d60e7c6-611b-c2b9-b43e-af37c0154ad6\",\"facts\":[{\"title\":\"StartDate:\",\"value\":\"2022-08-11\"},{\"title\":\"EndDate:\",\"value\":\"2022-08-11\"}]}],\"width\":\"stretch\",\"spacing\":\"Small\",\"padding\":\"None\"},{\"type\":\"Column\",\"items\":[{\"type\":\"FactSet\",\"id\":\"274d7b95-17ae-ff6d-fa93-27568cf0fb2c\",\"facts\":[{\"title\":\"Days:\",\"value\":\"1\"}]}],\"width\":\"stretch\",\"spacing\":\"Small\",\"padding\":\"None\"}],\"padding\":\"None\"},{\"type\":\"ColumnSet\",\"columns\":[{\"type\":\"Column\",\"items\":[{\"type\":\"TextBlock\",\"horizontalAlignment\":\"Left\",\"text\":\"1.\",\"wrap\":true,\"size\":\"Medium\"}],\"width\":\"auto\",\"padding\":\"None\",\"spacing\":\"None\"},{\"type\":\"Column\",\"items\":[{\"type\":\"FactSet\",\"id\":\"9d60e7c6-611b-c2b9-b43e-af37c0154ad6\",\"facts\":[{\"title\":\"StartDate:\",\"value\":\"2022-08-09\"},{\"title\":\"EndDate:\",\"value\":\"2022-08-10\"}]}],\"width\":\"stretch\",\"spacing\":\"Small\",\"padding\":\"None\"},{\"type\":\"Column\",\"items\":[{\"type\":\"FactSet\",\"id\":\"274d7b95-17ae-ff6d-fa93-27568cf0fb2c\",\"facts\":[{\"title\":\"Days:\",\"value\":\"2\"}]}],\"width\":\"stretch\",\"spacing\":\"Small\",\"padding\":\"None\"}],\"padding\":\"None\"}"
This is infuriating me now 😫, if anyone has any ideas on how to use the string as it's presented in the front end and not the "raw" string with all the extra characters It would be much appreciated!