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 Apps / How to pass concat str...
Power Apps
Unanswered

How to pass concat string to FLow and keep output on seperate lines

(0) ShareShare
ReportReport
Posted on by 514

In PowerApps I have a string value that has carriage returns.

 

So it comes out as

 

Name1 Value1

Name2 Value2

 

When I pass this to FLow, I set it as Initialize Variable value of string.

I then add it to the SendEmail and the result of the email is all on one line

 

Name1 Value1 Name2 Value2

 

How can I retain the line breaks and keep it on separate lines as per the string that was passed in from PowerApps?

 

Thanks

Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Are you sure the string you are passing contains both Carriage Returns Char(13) and Linefeeds (Char(10).  Both are required for email.

  • sienna28 Profile Picture
    514 on at

    This is my string, set to a variable.

    The variable is passed to the flow.

     

    Set(AllRecs,Concat(Gallery1.AllItems, "Ref:" & txtRef & " - " &  "Client:" & txtName & Char(10) & Char(13) &  ""))

  • TiagoFreire Profile Picture
    313 on at

    Maybe you should try using the JSON() function on PowerApps and pass a structured object serialized into a JSON string, then using JSON.Parse() on Power Automate (Flow) to turn it back into variables. I have been using this to have flexibility on parameter passing, and it has been working well for me. 

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    I did some checking and passing a string with Char(10) and Char(13) does work in the sense that it gets to the flow.  But when you load it into the Email that strips out the carriage returns and line spaces.  I'm trying to find a way to replace them with <br/> in the string before we load the  string into the email.  Its not passing them to Power Automate that is causing the problem.  Its the way the body of the email formats the string.

  • sienna28 Profile Picture
    514 on at

    Thank you.

     

    I also tried switching on the HTML option in the SendEmail action, but that did not seem to do much either.

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Switching on the HTML option won't help, since Carriage returns and linefeeds are ignored in HTML.  That's the problem.  I'm still looking for a way to format this where the email will honor the linefeeds, but I haven't found a solution yet.

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Ok, I found a solution.  The key is to pass the string to Power Automate as a JSON array.  Then in the flow you do the following

    • Use Parse JSON to turn the string into an array
    • Use Create HTML table to create an HTML table from the Array
    • Insert the HTML table into the email

    Here's the code I used in Power Apps to create the JSON array. (hint "" will come through as a literal " embedded in the string

    Set(AllRecs,Concatenate("[", Concat(Gallery1.AllItems, "{""Ref"":""" & txtRef & """," & """Client"":""" & txtName & """},"),"]"));
    'PowerApp->Compose'.Run(AllRecs);
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Here's an easier way to pass the AllItems as a JSON array.

    'PowerApp->Compose'.Run(JSON(DropColumns( Gallery1.AllItems,"SampleImage","NextArrow1"),JSONFormat.IgnoreUnsupportedTypes));

    DropColumns removes unsupported data type columns from the Gallery1.AllItems table before converting to JSON. It depends on how many columns you have how easy this would be.

  • sienna28 Profile Picture
    514 on at

    I managed to solve this one.

    I added "<br> into the PowerApps string.

    Took out the control characters

    It seemed to pass across to the flow with the tags.

     

    Thanks for looking at it for me.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard