Skip to main content

Power Automate Losing Formatting When Sending Emails

Fixing Line Break and Formatting Issues in Emails Sent via Power Automate

Updated over a week ago

In some cases, it may be useful to send email notifications via Microsoft Power Automate instead of using Team Forms’ built-in email notifications—especially when you need to send different emails to multiple recipients simultaneously.

Just like with the built-in email feature, Power Automate allows you to reference response fields (such as text areas) to dynamically build your email content. However, you may notice that when embedding a text area response into the email body, the formatting appears incorrect—for example, all text may appear on a single line without line breaks.

This issue occurs because Power Automate’s “Send an Email” action expects the body to be formatted in HTML, while the text area captures plain text (which includes line breaks that HTML does not automatically interpret).

There are two common solutions to ensure the formatting is preserved:

Option 1: Change Your Text Area to Output HTML

  1. Edit your form in Team Forms and locate the text area field.

  2. Open the component settings, then navigate to the Display tab.

  3. Under Editor, switch to a rich text editor such as CKEditor or Quill.

  4. Save and publish your changes.

Any new responses submitted after this change will store the text area content in HTML, preserving formatting such as line breaks, bold text, and bullet points when referenced in Power Automate emails.

Option 2: Update Power Automate to Convert Plain Text to HTML

If you prefer to keep the text area in plain text mode, you can update your Power Automate workflow to manually convert new lines (\n) into HTML line breaks (<br/>).

  1. Open your Power Automate flow.

  2. Locate the section where you reference the text area in your email body.

  3. Replace the dynamic content with the following expression, adapting it to your field name:

replace(triggerOutputs()?['body/data/plainTextTextArea'], decodeUriComponent('%0A'), '<br/>')

This expression replaces newline characters with <br/> tags, allowing the email to preserve the intended formatting in the HTML email body.

Did this answer your question?