Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

How to add new line (‘\n’) to a string in Power Automate

Posted on April 28, 2021May 23, 2021 by Tom

“I am building a Power Automate flow and need to append values into a string variable, how can I add a new line/line feed into the variable”


When you build a string in Power Automate, sometimes you don’t want one long string. Having everything on a single line might be easier to work with, but terrible to read. And if user readability is important for your solution, you might need to add a few line breaks. In a reverse to replacing new lines, let’s take a look on adding new lines to a string.

Add new line in an action

The simplest solution is to add the new line directly in the editor. Enter all the dynamic content you want to turn into a string, including the format, into an action. You can use spaces, new lines, special characters… design the whole string visually.

Power Automate add a new line to a string

Note: if you’re appending the string to a variable, don’t forget to add one extra new line at the end. The next string will start on the new line.

Add new line to concat(…) expression

Another approach to building a string is using an expression. Instead of a separate action to build it visually, you can use the concat(…) expression. It’ll take all the values separated by a comma and turn them into a string.

concat('string1','string2','string3')
->
string1string2string3

To add a new line into the string you must add the ‘new line’ character as one of the values. There’re three options how to do that.

Add ‘Enter’ into the expression

The first one is to add ‘Enter’ into the expression. Add opening single quote, press Enter on your keyboard, and then add the closing single quote. It’ll split the expression on multiple lines, but Power Automate will translate it as a new line character.

concat('string1','
','string2','
','string3')
->
string1
string2
string3
Power Automate add new line

Create ‘new line’ variable and use it in the expression

The second approach is to create a new variable with the ‘new line’ character. Initialize a new string variable, and in the ‘Value’ field press Enter. Such variable can then be used in the concat(…) expression as a new line.

concat('string1',variables('var_newLine'),'string2',variables('var_newLine'),'string3')
->
string1
string2
string3
Power Automate add new line variable

Use decodeUriComponent(‘%0A’) expression

The third, and my preferred approach is to use the decodeUriComponent(‘%0A’) expression. As already explained in the article on replacing new lines in a string, the expression will give you the ‘new line’ character. With this expression you don’t need a special variable nor depend on the expression “layout”.

concat('string1',decodeUriComponent('%0A'),'string2',decodeUriComponent('%0A'),'string3')
->
string1
string2
string3
Power Automate add new line expression

Summary

As you can see, it can be simple or not so simple to add a new line to a string in Power Automate. If you can format the string directly in an action, do it. It’s easy to design, easy to work with, and it can be done by everyone without the expressions knowledge. It’s an approach I use when building simple approval history on document libraries in plain text instead of html table.

The expression approach can get a bit confusing if you’re building strings from multiple pieces. As you can’t format the string visually, it’s quite easy to get lost in all the pieces of the expression. I’d recommend using it only if you can’t format the string in an action, e.g. when exporting data to .csv or creating an html table.

And as already mentioned in a note, if you’re appending to a string, don’t forget to add a new line at the end of each string.


🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

11 thoughts on “How to add new line (‘\n’) to a string in Power Automate”

  1. Joseph Boland says:
    August 1, 2021 at 12:06 am

    Thanks! Used decodeUriComponent easily and successfully to format the Notes field in a Planner task with output from a Forms survey.

    Reply
  2. Alan says:
    September 9, 2021 at 4:15 pm

    Thank you SO MUCH! I have been trying to figure this out for a little while and have not found a solution that works until I found this blog post. Cheers!

    Reply
  3. Anitha says:
    November 10, 2021 at 7:58 pm

    Much useful. Thank you.

    Reply
  4. Marcio says:
    December 14, 2021 at 3:38 pm

    Great! thks!

    Reply
  5. Valentin Joubert says:
    January 2, 2023 at 11:45 am

    Great THX

    Reply
  6. Ana says:
    May 8, 2023 at 5:28 pm

    Hello!

    I have a string variable in a for each where I concatenate several strings and I want to finish with a new line for the following iteration to store the values in a new line because I need to show those values into an e-mail that I´m sending, but I´ve tried all the ways explained, and none worked for me 🙁 It’s still printing the values without line break, any ideas? I would be very gratefull if you could help me 🙂

    Thanks in advance,
    Regards

    Reply
    1. Tom says:
      May 28, 2023 at 2:57 pm

      Hello Ana,
      emails use HTML formatting so I’d try adding the
      tag at the end of the line instead of this solution.

      Reply
  7. Ram says:
    July 16, 2023 at 10:22 am

    Thanks a lot, saved me so much time.

    Reply
  8. Brandon says:
    December 7, 2023 at 11:32 pm

    Thanks! decodeUriComponent worked like a charm.

    Reply
  9. Lucas says:
    February 28, 2024 at 7:24 pm

    I use
    concat(items(‘For_each’)?[‘Title’],”)

    and it works fine

    Reply
  10. Christopher Lees says:
    October 29, 2024 at 7:33 am

    Thanks for this guide. I hate all these tiny little papercuts in Power Automate. Why can’t it just use the completely standard “\n”, or failing that, just a “newline()” function? There’s so many similar things where, in order to do something simple in Power Automate, you have to go in this very roundabout hacky way.

    Power Automate is so useful but there’s so many dumb little rough edges.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundle—everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes