Skip to main content
Community site session details

Community site session details

Session Id : QFoMCQfQuPIX0hfH1YtMPy
Power Automate - Building Flows
Suggested answer

Remove /r/n and /r from flow.

Like (0) ShareShare
ReportReport
Posted on 25 Jun 2024 11:39:17 by 64

Hi All,

I have been working on this flow and run into a few problems which by the help of some amazing people on here have been fixed. This is the latest problem I am facing.

Watkins_3-1719315277126.png

So everything is working correctly, but in order for this to then be uploaded to our other software, the \r and \r\n that is showing up on the create file output would need to be removed, is there a way to do this?

Note that this is the way the data comes in and I can't change that as its coming from a piece of limited functionality hardware, can this be done with a replace at the end of the flow or would there need to be something beforehand to prevent the /rn and /r from showing? as its interfering with the data upload. 

Watkins_4-1719315381724.png

So I would just need to remove the \r and the \r\n so its not interfering with our data upload can provide any other screenshots if needed. 


Thanks,
Watkins.

  • Suggested answer
    NH-09041120-0 Profile Picture
    2 on 09 Apr 2025 at 11:25:34
    Remove /r/n and /r from flow.

     Quite an old post, I know, but for anyone who's still struggling with this here's a solution I found on Stack Overflow: Remove \r from a power automate string - Stack Overflow

    Use Replace() function and denote \r as decodeUriComponent('%0A')

    Sample:

    replace('string\r',decodeUriComponent('%0A'),'')

    Here are the keys:

    1. decodeUriComponent('%0A') => \r
    2. decodeUriComponent('%0D') => \n
  • Watkins Profile Picture
    64 on 25 Jun 2024 at 14:10:44
    Re: Remove /r/n and /r from flow.

    Hi @abm ,

    So I tried to do this with a few variations and took the output from 'replace_brackets' this is what happened,

     
    replace(replace('replace_brackets', '\r', ''), '\n', '')
      Output is just replace_brackets
    replace(outputs('replace_brackets', '\r', ''), '\n', '')
      Returns the below error,Watkins_0-1719322923751.pngreplace(outputs('replace_brackets'),'\r','')
      To see if just trying to replace one works, does work but doesn't replace. See screenshot of output below.
    Watkins_2-1719323759111.png
     
    I did also try 'Create_CSV_table' still didn't work. The \r and \r\n only show up on the Create CSV table input and the create file output, below is how the data looks before it goes through the flow just saved as a CSV file and opened in notepad. I'm not sure how to remove the \r,\rn from the flow.
    Watkins_6-1719324183699.png

     

    Thanks,
    Watkins.
  • abm abm Profile Picture
    32,506 Most Valuable Professional on 25 Jun 2024 at 12:03:23
    Re: Remove /r/n and /r from flow.

    Hi @Watkins 

     

    Try using the replace expression.

     

    replace(replace('Here replace your string', '\r', ''), '\n', '')

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!

Loading complete