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 / base64tostring issues ...
Power Automate
Answered

base64tostring issues with \r\n

(2) ShareShare
ReportReport
Posted on by 133
hi all,
 
My flow do not succeed in converting a bas64 string extracted from a .eml file.
 
what would be the most suitable solution to this?
 
I 've tried to replace \n and \r, or to split \r\n but no positive result so far
 
thank you
 
I have the same question (0)
  • Suggested answer
    Haque Profile Picture
    1,419 on at
    Hi @SP-04091518-0
     
    Probably, the main issue with replace function is, it is trying to replace literal strings like '\\r' and '\\n' instead of the actual carriage return and newline characters. In Power Automate expressions, to replace actual line breaks or carriage returns, you need to use the escape sequences for those characters, not their string representations.
     
    Please try these:
    • Use '\r' and '\n' (without double backslashes) in the replace function.
    • Or use the replace() function with the actual characters using the '\r' and '\n' escape sequences.
     
    Please try this code:
    replace(
        replace(
            replace(
                replace(last(outputs('Message_1')), '\r\n', ''),  // Remove CRLF
            '\r', ''),                                         // Remove CR
        '\n', ''),                                            // Remove LF
    ' ', '')                                                // Remove spaces if needed
    
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Verified answer
    SP-04091518-0 Profile Picture
    133 on at
    I solved my issue by using decodeUriComponent and %0D and %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

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 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard