Skip to main content
Community site session details

Community site session details

Session Id : 3NoCz9evoIrY9Xv7MhQMwO
Power Automate - Power Automate Desktop
Answered

Splitting Text with "New Line" Delimiter

Like (0) ShareShare
ReportReport
Posted on 15 Sep 2023 02:44:59 by 158

Hello,

 

I am trying to map the text in an Excel cell to a textbox in a webpage, but Power Automate writes all the text consecutively and ignores new lines. To solve this, I tried to split the text by using the "new line" delimiter but the issue still remains. The "Populate text field in webpage" action is a non-option because it deletes the entry of the previous index when making the entry for the current index.

 

Also, the "send keys" action does not write the first letter of the first word.

 

How can I map the text exactly as shown in the Excel cell?

 

Screenshot 2023-09-14 at 8.34.14 PM.png

 

Screenshot 2023-09-14 at 9.42.12 PM.png

 

Screenshot 2023-09-14 at 9.26.56 PM.png

  • OnurOnal Profile Picture
    158 on 27 Sep 2023 at 18:00:17
    Re: Splitting Text with "New Line" Delimiter

    @Pavel_NaNoi,

     

    This solves the issue, thank you for the help.

  • Verified answer
    Pavel_NaNoi Profile Picture
    1,072 on 25 Sep 2023 at 09:23:59
    Re: Splitting Text with "New Line" Delimiter

    Ah, apologies, I forgot to mention the most important part!

    In your Populate text field on web page, untick "Populate text using physical keystrokes"

    Pavel_NaNoi_0-1695633825493.png

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on 24 Sep 2023 at 12:24:33
    Re: Splitting Text with "New Line" Delimiter

    Try deactivating escape sequences in Replace text. Also, are you still doing this with Send keys?

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

     

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • OnurOnal Profile Picture
    158 on 23 Sep 2023 at 19:22:33
    Re: Splitting Text with "New Line" Delimiter

    @Pavel_NaNoi,

     

    The break points are found with \n, but the Replace with: \n<BR> part does not create a new line. Instead it outputs the text "<BR>" between the break points. \r produces the same result as well.

     

    Screenshot 2023-09-23 at 1.11.14 PM.pngScreenshot 2023-09-23 at 1.12.41 PM.png

  • OnurOnal Profile Picture
    158 on 23 Sep 2023 at 18:03:21
    Re: Splitting Text with "New Line" Delimiter

    @Agnius,

     

    \r?\n successfully detects the new lines, but the problem is with the Replace text: {Enter} part. The actual text '{Enter}' is outputted in the breakpoints rather than the key {Enter}. Is there a way I can send an enter key inside the Replace text action?

     

    Screenshot 2023-09-23 at 12.19.27 PM.pngScreenshot 2023-09-23 at 11.27.22 AM.png

  • Pavel_NaNoi Profile Picture
    1,072 on 22 Sep 2023 at 14:06:24
    Re: Splitting Text with "New Line" Delimiter

    I've come across this before, do me a favour, in a vacuum setting, just set up a "Launch a browser instance" (whichever you use) and have it attach to the window in which you want to write your text into, now just use a "Populate text field on webpage" with emulated typing and write this into the box:

     

    Some issues were spotted in the ticket:
    <BR>
    <BR>
    Some Note

     

    (<BR> is an HTML tag for a Single Line Break, i.e. new line)

    See if that creates two new lines for you, if it does, proceed with the following:

    Instead of splitting your text, just use a Replace text,

    In your Replace text, create it as in the image below, replace  %NewVar% with the variable containing all the text from the cell:

    Pavel_NaNoi_0-1695391350612.png

    (If it does not work first time try \r as suggested if it is indeed carriage returns)

     

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on 22 Sep 2023 at 04:50:09
    Re: Splitting Text with "New Line" Delimiter

    Try experimenting with different expressions you may need. For instance, try simply using \r (which stands for a carriage return) instead of \r?\n. If Replace text doesn't find the exact pattern, it will simply not replace anything, but will keep the original value in %Replaced%. So, if your value does not actually have newlines (to be replaced by \n) but only has carriage returns, using \r?\n will not replace anything, but \r could.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • OnurOnal Profile Picture
    158 on 21 Sep 2023 at 19:33:07
    Re: Splitting Text with "New Line" Delimiter

    @Agnius,

     

    The Replace text action produces the same result as the Split text action. The text is still mapped into one line and new lines are ignored. Here is an image of the actions I am using. Is there something I am missing?

     

    Screenshot 2023-09-21 at 1.48.04 PM.png

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on 21 Sep 2023 at 06:48:33
    Re: Splitting Text with "New Line" Delimiter

    Okay. Why are you using the clipboard there? You don't need to set the clipboard text and then get it. You already have the value in a variable.

    Also, I don't see any Replace text actions there. As suggested, if you want to use Send keys (which is recommended, because Populate text field in web page does in fact ignore newlines), you should use Replace text to replace \r?\n (using regex) with {Enter} so that the Enter key is sent by Send keys to create a new line.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • OnurOnal Profile Picture
    158 on 20 Sep 2023 at 17:58:33
    Re: Splitting Text with "New Line" Delimiter

    The values are pulled from the appropriate cells. The issue is that the text in the Excel cell has new lines (circled in image 1 of 2), and the text that Power Automate maps ignores new lines (circled in image 2 of 2).

     

    Screenshot 2023-09-20 at 12.57.05 PM.png

     

    Screenshot 2023-09-20 at 12.54.41 PM.png

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2