Human Capital Management Blogs by Members
Gain valuable knowledge and tips on SAP SuccessFactors and human capital management from member blog posts. Share your HCM insights with a post of your own.
cancel
Showing results for 
Search instead for 
Did you mean: 
akash8960
Newcomer

While querying the data from SF OData API of the base entity FOCostCenter i did receive the following error - 

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>BadRequestException</code>
<message lang="en-US">Invalid quote usage detected, quotes need to be in pairs.</message>
</error>

This did lead me to a spiral of what went wrong, after a bit of head scratching i did figure out my SF OData API query was : 


/FOCostCenter?$select=externalCode,name&$filter=externalCode eq 'A & B' 

 Well, the issue here is with having "&" between A and B. OData API parser by default expect to have a after A and before B. In order to handle this we need to escape & symbol. As usual i escaped it by replacing & with &amp; but then it did not work. 

Understanding the protocol of OData API i was led to beleive escaping needs to supported by ASCII format which is %26 which helped us to solve the problem. 

Updated query condition which solved the problem is here. 

/FOCostCenter?$select=externalCode,name&$filter=externalCode eq 'A %26 B' 

 

End of the long story - if you need to escape special characters within filter condition of OData then please use ASCII encoding. 

Labels in this area