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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Removing a "\r" charac...
Power Automate
Unanswered

Removing a "\r" character from a string

(0) ShareShare
ReportReport
Posted on by 11
Howdy all,
 
Currently my flow has a string that has a "\r" character in it and I cannot figure out how to remove. There's two compose actions where I could remove it, 
 
In the first one the string is produced by: first(input array) and the string output looks like this: 
"84739,99294,35243.04,49535,0.393,1.481\r"
 
In the second one that string is converted to an array via the split() function and combined with another array into a single long string that looks like:
"84739,99294,35243.04,49535,0.393,1.481\rTE545063,Company,Employee,650,...." The string continues bit the \r is show there.
 
That 1.481 number will change as it's a varied test result so I can't reference that directly.
 
It can be changed in either compose statement, I just need the \r to not be there.
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,697 Most Valuable Professional on at
    /r is what you get for an escaped carriage return.  Try doing a replace() with Char(13) as the target and replace it with a space.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Garima_PowerPlatform Profile Picture
    170 on at
    Hi

    Step 1: Removing from a string

    • Compose Action:
      replace(first(outputs('Your_Input_Array')), '\r', '')
    Step 2: After Splitting and Combining
    • Compose Action:
      replace(outputs('SplitArrayCombined'), '\r', '')
    Replace outputs('Your_Input_Array') and outputs('SplitArrayCombined') with the appropriate flow outputs.

    Notes:

    • The replace() function in Power Automate replaces all instances of the specified substring.
    • Ensure the context matches where the string with the \r appears and apply the replacement.
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
     
  • Suggested answer
    Garima_PowerPlatform Profile Picture
    170 on at
    Hi

    Step 1: Removing from a string

    • Compose Action:
      replace(first(outputs('Your_Input_Array')), '\r', '')
    Step 2: After Splitting and Combining
    • Compose Action:
      replace(outputs('SplitArrayCombined'), '\r', '')
    Replace outputs('Your_Input_Array') and outputs('SplitArrayCombined') with the appropriate flow outputs.

    Notes:

    • The replace() function in Power Automate replaces all instances of the specified substring.
    • Ensure the context matches where the string with the \r appears and apply the replacement.
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
     
  • BS-16011335-0 Profile Picture
    2 on at
    I was able to get it to work using this replace:
     
    replace(outputs('Prior_Step_Name'),decodeUriComponent('%0D') ,'')

    For my specific example, I was trying to remove blank lines that looked like '\r\n\r\n' (want to replace double line feeds with a single), and for that I used this:

    replace(outputs('Prior_Step_Name'),decodeUriComponent(
    '%0D%0A%0D%0A') ,decodeUriComponent('%0D%0A'))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard