web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove /r/n and /r fro...
Power Automate
Suggested Answer

Remove /r/n and /r from flow.

(0) ShareShare
ReportReport
Posted on by 70

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.

Categories:
I have the same question (0)
  • abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @Watkins 

     

    Try using the replace expression.

     

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

  • Watkins Profile Picture
    70 on at

    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.
  • Suggested answer
    NH-09041120-0 Profile Picture
    4 on at

     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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 639

#2
Valantis Profile Picture

Valantis 392

#3
11manish Profile Picture

11manish 350

Last 30 days Overall leaderboard