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 / Filter query in Get Re...
Power Automate
Answered

Filter query in Get Records fails if criteria contains a '

(0) ShareShare
ReportReport
Posted on by 24

I use the Get Records against Sales Force and I use the filter query to detect a row containing certain criteria.

It normally works but it fails if the criteria contains a '

beatrizfuster_0-1593426346651.png

If value is "Cote D'Ivori" then the filter Query fails:
{
  "status"400,
  "message""There is an unterminated literal at position 34 in 'GEOLeve4Name__c eq 'Cote D'Ivoire''.\r\n     inner exception: There is an unterminated literal at position 34 in 'GEOLeve4Name__c eq 'Cote D'Ivoire''.\r\nclientRequestId: 02b0bb1c-4cbc-426c-824f-2d7dc975cf85",
  "error": {
    "message""There is an unterminated literal at position 34 in 'GEOLeve4Name__c eq 'Cote D'Ivoire''.\r\n     inner exception: There is an unterminated literal at position 34 in 'GEOLeve4Name__c eq 'Cote D'Ivoire''."
  },
  "source""salesforce-ne.azconn-ne.p.azurewebsites.net"
}
 
Any clue on how to fix that?
Categories:
I have the same question (0)
  • Verified answer
    abm abm Profile Picture
    32,985 Most Valuable Professional on at

    Hi @beatrizfuster 

     

    Most likley the issue is related to single quotes  after D.

    'Cote D'Ivoire'

     

    I have replied another post similar to this issue but not specific to Salesforce. Please have a look and let me know.

     

    https://powerusers.microsoft.com/t5/Using-Flows/Unable-to-get-user-Send-an-HTTP-request-to-SharePoint-when-email/m-p/610265#M15676

     

    Thanks

     

     

  • beatrizfuster Profile Picture
    24 on at

    Thanks. Your answer help me to find the fix:

     

    replace(items('Apply_to_each')?['Department']?['Value'],'''','''''')

     

    Thanks!

  • Rohit Sharma354 Profile Picture
    Microsoft Employee on at

    Hello,

     

    Yes, the solution provided by @abm should work in your scenario as well.

     

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 419

#2
Vish WR Profile Picture

Vish WR 314

#3
David_MA Profile Picture

David_MA 260 Super User 2026 Season 1

Last 30 days Overall leaderboard