How to Fix Missing Line Breaks in Power Automate Desktop for RPA, Email, and Web Automation

If you’ve ever used Power Automate Desktop (PAD) for robotic process automation (RPA), you might have encountered missing line breaks in your text. Whether you are sending emails, filling out web forms, or automating UI inputs, missing linebreaks can make your output look messy and unprofessional.
I encountered this issue while working on a recent RPA process for a customer. The same problem appeared in two scenarios, each requiring a different solution.
- Problem 1: Email Formatting – My text looked fine in the editor but arrived in the recipient’s inbox as one continuous block. This was easy enough to fix. Emails in PAD require HTML formatting for line breaks to appear correctly, so I just had to substitute HTML line breaks (more on this below).
- Problem 2: Web Form Input – I copied that email content into a web form, but the field ignored standard linebreaks and wouldn’t parse HTML. How, then, was I supposed to format my string?
Like any good developer, I turned to web searches, browsing documentation, and interrogating my favorite AIs, but with mixed results. Solutions for email formatting were well-documented, but one Reddit post chronicled years of developers struggling with web forms. Was there no fix?
Well, it turns out I—like those Redditors before me—was asking the wrong question. Instead of “How do I get linebreaks into my strings?” the real issue was:
“How do I stop Power Automate Desktop from removing them?”
Handling linebreaks correctly in RPA processes is more than a minor formatting issue—it’s essential for professional communication and ensuring end-user adoption. In this post, I’ll demonstrate:
- How to ensure linebreaks appear correctly in emails and HTML-based inputs
- How to maintain formatting when filling out standard web forms
- How to maintain formatting in UI automation and with more difficult web forms
- How to use last-resort methods when other options fail
The Solutions
Problem 1: Missing Linebreaks (Newlines & Carriage Returns) in Emails & HTML Fields
If you’ve ever sent an email from Power Automate Desktop (PAD), you might have noticed your neatly formatted text arriving as one big block.
This happens because PAD doesn’t recognize regular newlines or carriage returns (\r, \n, or \r\n) when sending emails. It won’t parse the escape characters and ignores line breaks you enter manually. Instead, it expects HTML formatting. That means if you enter something like this:

The email will arrive looking like this:

The Fix: Convert Carriage Returns & Newlines to HTML Line Breaks
Since PAD emails use HTML encoding, you must replace carriage returns and newlines with <br> tags. If you’re manually writing the text, insert <br> as you see below:

PAD will parse your HTML and format the email accordingly:

The same is true of any field or process that accepts HTML input. On the other hand, if you get the string from another source, you’ll need to automate the replacement of line feed characters. You can do this with the Replace Text action.
Configure the action as shown below:

- Text to parse: Enter your string variable.
- Text to find: \r\n|\r|\n
- Use regular expressions for find and replace: Toggle this on
- Replace with: <br>
Other settings can be left at default values, although I recommend giving the produced variable a better name. If you don’t need the unaltered text elsewhere, consider saving your results to the original string to reduce clutter in the variables pane.
This approach will replace any traditional line breaks, Windows- or Unix-style, in your string with HTML break tags. You can then use the variable produced in other actions that require HTML input, such as emails.
Problem 2: Missing Linebreaks in Web Forms & UI Inputs
The second way this problem occurs is when sending text with newlines or carriage returns into a form using Power Automate Desktop (PAD), either with the Populate text field in a window or Populate text field on web page actions. As with the email, the text appears as a single block. Many forms don’t support HTML line breaks (<br>), and Power Automate Desktop removes newlines from text inputs by default.
Why does this happen?
By default, Power Automate Desktop enters text using physical keystrokes. This mode handles most forms effectively by sending text precisely as a human would, but there’s a caveat: sending a linebreak as a human would means pressing the enter key. Doing so can have unintended consequences on some forms, such as submitting data early instead of creating a new line. To avoid this, Power Automate Desktop skips linebreaks.
Fortunately, if you want those linebreaks, there are several ways to keep them.
Fix 2a: Populate text field on web page
The easiest way to fix disappearing linebreaks in web forms is to turn off sending physical keystrokes. To do so:
- Locate the Populate text on web page action in your flow.
- Open the Advanced settings.
- Toggle off the Populate text using physical keystrokes option.

When you do, a new Emulate typing option will appear like so:

If possible, I also recommend turning emulated typing off. Without this setting, the robot will send the text to the box all at once, much like a copy/paste action. Leaving this on causes the robot to send the text character by character. Doing so still preserves your linebreaks, but it will take longer.
However, some systems will require emulated typing. If your text entry fails without it, leave the setting on. The loss of speed will be worth it to get your text entered correctly.
If you cannot enter text without physical keystrokes, proceed to fix 2b.
Fix 2b: When you need the Send keys action
Not all text inputs are websites and emails, and occasionally, an older, usually custom-made website will require physical keystrokes. If you need UI automation or physical keystrokes, your next best bet is the Send keys action.
Before proceeding, check how a human user would send linebreaks in the text box. If a human user can enter a linebreak, you need to figure out how and have the robot imitate that process.
NOTE: If a human user cannot enter a linebreak, the robot can’t either. In that case, talk to whomever wrote your process requirements and explain that the target system does not allow linebreaks. Determine together how to revise your process.
If this process involves sending the correct keys, configure the Send keys action. If it requires another method, proceed to fix 2c.
If hitting enter is fine, you can use the Send keys action like the Populate text in window action. Enter the string, complete with linebreaks, and the robot will hit enter whenever it reaches a new line.
For example:

Be warned that this may reintroduce the problem that removing linebreaks was meant to avoid. If the enter key performs some other action on the page or in the application, it will do so when the robot enters your string.
If you need a different key or key combination, the solution is almost identical to the HTML solution. The only difference is that instead of replacing the text with <br>, you replace it with the encoded key combination to produce your linebreak. The send key action includes tools to help you create these encodings. You can find them here:

The modifier is the key to be held down, and the special keys are the keys to be pressed and not held. The encoding will end with parentheses () when using the modifier menu. Any keys to be pressed while the modifier is held down go inside those parentheses. For example, shift + enter is {LShiftKey}({Enter}).
If using shift+enter, your replace text action would look like this:

Then you pass that string to the send keys action:

Your robot should now populate the field with the linebreaks intact.
Fix 2c: Linebreaks not from keys.
To be thorough, let’s assume a worst-case scenario: A human can send linebreaks, but they do so with a method other than keystrokes. This scenario is extremely unlikely, but anyone who has done RPA long enough will know better than to rule out this absurdity. Sometimes, the software you automate is just like that.
As an absolute last resort, you can split your text into a list with the Split text action like so:

This configuration will give you a list of strings divided where the linebreak belongs. Now execute a For each loop like so:

Send the current item to the field in each iteration using the appropriate method. For example:

Ensure the action is set to append rather than replace the text. You can find this in the advanced settings here:

Lastly, perform whatever action is necessary to create your linebreak and continue the loop. Again, this is a last resort method. It should function, but the extra steps generate more work and leave more opportunities for error. It’s better to save time and headaches using a more straightforward approach.
Conclusion:
Handling line breaks when inputting text via Power Automate Desktop is usually straightforward but requires case-by-case configuration.
- Emails need <br> tags.
- Web forms often require turning off physical keystrokes.
- Some systems need the Send Keys action with special encoding.
- If all else fails, split the text into a list and append it line by line, performing actions to add the line breaks between steps.
Choosing the proper method for your situation ensures clear, professional communication and a smoother automation process.
