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 / Adding line break in a...
Power Automate
Unanswered

Adding line break in array of strings

(0) ShareShare
ReportReport
Posted on by 20

Hello,

 

I have been trying to turn a list of answers from a Form into a broken up list (I've included pictures to show what it's doing instead).

 

My end result should be along the lines of:

Item 1,

Item 2,

Item 3,

 

But instead it's giving it all on one line despite me joining the items in the array using a line break <br>. I'm unsure what I'm supposed to be doing differently as the Join structures are outputting it the way I'd want the email to read it, but as it hits the email, it's like it forgets that it was doing that and restructures.

 

If anyone could give me some guidance, I would much appreciate it.

linebreak2.PNGlinebreak.pnglinebreak3.PNG

Categories:
I have the same question (0)
  • Paulie78 Profile Picture
    8,422 Moderator on at

    That is because a <BR /> is a HTML tag, not a line break. So it depends on your intended output. If you are going to output that string to something that renders html, then the line breaks will be there. If you want line breaks for use in output that does not render html, then you need to join with: decodeUriComponent('%0A') like this:

    join(outputs('thingToJoin'), decodeUriComponent('%0A'))

    decodeUriComponent('%0A') simply represents a new line.

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    If you are going to use the string in something like an email or somewhere else that you don't have HTML then the easiest way to do this is initialize a Variable at the top of the program and add a carriage return to the variable by hitting the Enter key in the box.  You can then use that variable anywhere you want to put a carriage return/linebreak.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    For the purposes of clarity regarding @Pstork1 answer above. Pressing the enter key in a variable or a compose action will give you a LF (newline) not a carriage return. 

     

    In Windows a new line is typically comprised of a carriage return plus a line feed (CR+LF). In Unix/Linux/Power Automate/Almost everything else, it's just a LF. So...

     

    decodeUriComponent('%0A') - Is a LF (new line).

    decodeUriComponent('%0D%0A') - Is a CRLF (Carriage Return + Line Feed).

     

    In either case probably irrelevant as your intended output seems to be HTML.

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    I just rechecked and you are right.  But it does work.

  • CoryC Profile Picture
    20 on at

    I do apologize for not having explicitly mentioning that yes, this is going into an email. I figured since there's already <br> in the email itself (hence what the third picture is showing) when I check the email body input, it'd automatically consider the variable containing the joined array with <br> added in, it'd function the same, but the issue is that, even though it's reading <br> and putting it in with the email, that variable keeps kicking out the <br> I was going to use for line breaks upon it hitting the email's body.

  • ElfCabbage Profile Picture
    4 on at

    This doesn't work for me as this is what shows up in my email. The top one is an append to string after concat the delimiter and the bottom is a join using the delimiter. Got anything else?


    ["PathwayConnect Student Portal-Brent & Ricky (BYU-P) Troy Shoop (ICS-QA)"decodeUriComponent('%0D%0A')"Online Degree Portal (BYUI/Ensign Matriculated) Brent (BYU-P) Troy Shoop (ICS QA)"decodeUriComponent('%0D%0A')"QuickReg-Mike (BYU-P)  Mark Minson (ICS QA)"]decodeUriComponent('%0D%0A')
    --------------------------

    ["PathwayConnect Student Portal-Brent & Ricky (BYU-P) Troy Shoop (ICS-QA)"decodeUriComponent('%0D%0A')"Online Degree Portal (BYUI/Ensign Matriculated) Brent (BYU-P) Troy Shoop (ICS QA)"decodeUriComponent('%0D%0A')"QuickReg-Mike (BYU-P)  Mark Minson (ICS QA)"]

  • ElfCabbage Profile Picture
    4 on at

    Bwahahahaha! <br> actually works for me but how do I get rid of the brackets?

  • AkshayManke Profile Picture
    2 on at

    Hello @Paulie78 and @Pstork1,

     

    I am also facing exactly same issue and tried your suggested solution all the possible solutions but not getting the expected output. I would be really glad if you can please guide. 

     

    I got the issue that, the content is already an array, and we need to split the array with a specific delimiter. 

     

    Here is the link of my thread: Re: Split String using Delimeter and Add the Next ... - Power Platform Community (microsoft.com)

     

    Thanks in advance.!!

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard