cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
duffletmc
Frequent Visitor

Salesforce Get Items ODATA Filter Apostrophe Issue

Hi there,

 

I have a flow which is taking the account name field from Salesforce via the connector, then using get items with an ODATA filter to find the relevant account in a SP list

 
 
 

SF ACCOUNT.PNGgetitems.PNG

 

This works fine for account names with no apostrophe in, but I get this error (using an example of McDonald's Corporation') when they contain them

 

The expression "Title eq 'McDonald's Corporation'" is not valid. Creating query failed.
clientRequestId: 9c24c620-41b9-4f62-8875-dd4a54ffed17
serviceRequestId: 9c24c620-41b9-4f62-8875-dd4a54ffed17

 

What would be the best way to make this query work, ideally without changing the original name in Salesforce? 

 

1 ACCEPTED SOLUTION

Accepted Solutions
rohsh354
Community Support
Community Support

Hello,

 

Please refer to the thread below for the solution:

 

https://powerusers.microsoft.com/t5/Building-Flows/Using-a-value-with-a-single-quote-as-an-Odata-fil...

 

Single quote in OData Query need to present in pairs.

To replace a single quote in an dynamic OData Query String value where the example field is Department.

 

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

 

I hope this helps !

 

 

View solution in original post

1 REPLY 1
rohsh354
Community Support
Community Support

Hello,

 

Please refer to the thread below for the solution:

 

https://powerusers.microsoft.com/t5/Building-Flows/Using-a-value-with-a-single-quote-as-an-Odata-fil...

 

Single quote in OData Query need to present in pairs.

To replace a single quote in an dynamic OData Query String value where the example field is Department.

 

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

 

I hope this helps !

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (2,299)