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

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,189 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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard