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 / 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,865 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
    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

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

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard