Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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.

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: Build JSON object in variable for AdaptiveCard - MultiLine text field

    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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1