web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Build JSON object in v...
Power Automate
Answered

Build JSON object in variable for AdaptiveCard - MultiLine text field

(0) ShareShare
ReportReport
Posted on by

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.

Categories:
I have the same question (0)
  • Verified answer
    v-litu-msft Profile Picture
    Microsoft Employee on at

    Hi @BBW,

     

    You could add the isMultiline property into the object, for example:

    Screenshot 2021-02-22 115847.jpg

     

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 550

#2
Valantis Profile Picture

Valantis 390

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard