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 / Logic Apps - using rep...
Power Automate
Answered

Logic Apps - using replace() for single quote

(0) ShareShare
ReportReport
Posted on by 59

Hi all, 

 

In my HTTP Get request, I am trying to $filter by an expression using a replace() function on a string that includes a single quote. The string is an email address, and some addresses come in the below format: 

 

walter.O'Tool@email.com

 


The string comes from my current item which is:

 

 

items('For_Each_Contact')

 


I know this is probably so basic, but having researched online I still can't seem to get it correct. Following this blog: How to use string with apostrophe (') in Power Automate filter query (tomriha.com), I have tried: 

 

replace(items('For_Each_Contact,"'","''''")

 

 

I have also tried variations of it but still get a retuned error message that the expression is invalid. 

 

 

{
 "error": {
 "code": "0x0",
 "message": "Syntax error at position 32 in 'crde0_username eq 'walter.O'Tool@email.com''."
 }
}

 

 

Has anyone struggled also with this could point me in the right direction?

Many thanks, 

Frank

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @FrankKelp,

     

    The function replace also expects single quotes for its own parameters. I see you used double quotes instead.

     

    Can you try this expression?

     

    replace(items('For_Each_Contact'), '''', '''''')

     

     

    escape_singlequote.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

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 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard