Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

Keep new lines from Excel in emails sent by Power Automate

Posted on September 10, 2023September 10, 2023 by Tom

“I have email texts in an Excel file including new lines but when I send the email with Power Automate it removes all of them!”


When working with the free version of Power Automate, you probably use one of these applications as a database – SharePoint or an Excel file. Yet depending on the data type it might make a big difference in the rest of the flow. It applies mainly to the dates, but also the text columns can make a difference – especially those containing new lines. How does Power Automate recognise the new lines from an Excel file? And how can you keep them e.g. to send an email with a formatted text?

Use the correct new line character

Unlike the new line character in the flow designer, Excel uses a different representation. If you ‘List rows…’ and check the output, you’ll see that the new line is represented by the \n character.

It’s part of the returned string, there’re no special, invisible characters, just the \n.

Once you use it in a flow, it’ll automatically replace the \n with a different new line character.

A character that’s different from the one emails expect, which is why you must replace it. Since emails use HTML format, replace it with the <br> tag.

replace(outputs('Get_a_row')?['body/TextWithLines'],decodeUriComponent('%0A'),'<br>')
Power Automate new lines Excel

Once replaced the email will look as the text in the Excel file.

Power Automate new lines Excel

Summary

When you process data from an Excel file in Power Automate, you should always check what the data looks like in the flow. In this example you can see that Excel gives you new lines as \n and Power Automate replaces them automatically with its character. That’s where the automated conversions stop.

If you want to send the cell content in an email, you must do the next conversion manually. Replace the flow new line character with the standard HTML tag <br> and send the email.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

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

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

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 1000s of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes