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

Notifications

Announcements

Community site session details

Community site session details

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

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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard