Automaters,
I am trying to add a data from a multi-line text field (MS Forms) to a JSON object variable that I use to build an Adaptive Card. I tried replacing the \n with \n\n, but PowerAutomate escapes the string to \\n\\n when I add the output to my JSON object variable.
I would like to have each line in a separate text block anyway, so I created an array of the JSON text blocks. The output looks like this:
[
{
"type": "TextBlock",
"spacing": "small",
"text": "AAAAA",
"weight": "default",
"size": "default",
"wrap": true
},
{
"type": "TextBlock",
"spacing": "small",
"text": "BBBBB",
"weight": "default",
"size": "default",
"wrap": true
}
]
When I use the JSON function to create a JSON object, it will only pick up the first segment. If I use join to create a string, then the string gets escaped when added to the target JSON object.
How can I either create a valid JSON variable that looks exactly like the code above without the []? Alternatively, how can prevent Power Automate from escaping my string?
Thanks for your help!
B.
Hi @BBW,
You could add the isMultiline property into the object, for example:
For more information about the adaptive card input, you could refer to this document:
https://adaptivecards.io/explorer/Input.Text.html
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.
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1