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 / Remove /r carriage ret...
Power Automate
Unanswered

Remove /r carriage return from Parse Json

(0) ShareShare
ReportReport
Posted on by 16

What is the best route to remove the /r carriage return from a parse json?

 

mkohler281_0-1696522058734.png

 

Categories:
I have the same question (0)
  • Verified answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at

    Hi @mkohler281 

     

    Firstly it depends on if the value that you see \r is a string, or a special character. I know it looks like a string but its probably not

     

    You have a couple of options

    1. If it is a true string and you can do a replace(myvalue,'\r','') and replace it with a nothing

    -Note: But this only works if you do it to the value before it goes into the ParseJSON

     

    If you have to do it after its in the ParseJSON you have a few options, myself I would do #3, especially if there is anychance others have \r

     

    1. use SetProperty Function to change it, which would require essentially the same code as #3, but using a different method. 

    2. use a Select Action to essentially select out the columns of the Parese JSON.

    For each Key / Value you select out, you can do the code from #3 on the Value to remove the \r if there is one. 

     

    3) you could use a Compose and use the Compose to do the following

    This however takes the body of the Parse JSON, and either (if its a string) replaces all \r with '' and then turns it back into JSON. Or, it does the same thing but treats it like a special character and does the same thing and then turns it back into JSON

     

     

    if its a string
    json(replace(string(body('Parse_JSON')), '\r',''))
    
    if its not a string \r but the special character you do
    json(replace(string(body('Parse_JSON')), decodeUriComponent('%OD'),''))

     

     

    For All of these, your flow can no longer reference the Parse JSON body Dynamic values, because its no longer valid. The Output of the Action you use (Compose or Select) is actually now the reference point for the data going forward. You could use a Second ParseJSON to return it back to having Dynamic values though.


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • mkohler281 Profile Picture
    16 on at

    Thanks for the multiple solutions. This is the one that worked for me where I replaced the /r in the string with blank and then performed a second Parse Json off of that removeReturn output.

     

    mkohler281_0-1697040028645.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

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