Skip to main content

Notifications

Power Automate - General Discussion
Answered

How to compare a string with "\r\n" if it's true or false?

(0) ShareShare
ReportReport
Posted on by 48

Hello everyone,

 

I have the following output string with "\r\n" and I need to be able to compare this to have a True or False, if I have it has output.

maltiser_0-1710235033602.png

How are you comparing these situations?

 

Thank you

 

  • Verified answer
    maltiser Profile Picture
    maltiser 48 on at
    Re: How to compare a string with "\r\n" if it's true or false?

    Thank you for your reply, I don't have any characters there.

     

    I was able to compare that with this:

     

    decodeUriComponent('%0D%0A')
     
    Already did here some tests and it's working like a charm! (%0D for \r and %0A for \n)
  • Re: How to compare a string with "\r\n" if it's true or false?

    Hi @maltiser ,

     

    Do you want to check if string contains other characters? For example, "XXX\r\n" returns true?

     

    Two ways for your reference.

    1/Use equals condition to compare "XXX\r\n" and "\r\n".

    vmengmlimsft_2-1710236801971.png

     

    2/Compare length of "XXX\r\n" and length of "\r\n".

    vmengmlimsft_1-1710236631696.png

     

     

     

    Best regards,

    Rimmon

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard