SAP Knowledge Base Article - Public

3543261 - Query in OData API returning all locales when using filter- Recruiting Management

Symptom

For this article, we will consider PicklistLabel/locale as an example.
Querying in ODATA API, and filtering the values by locale. The response payload is bring all the values, not respecting the filter.

*** Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental. ***

Environment

SAP SuccessFactors Recruiting Management 

Cause

This is a ODATA API limitation, when there is a One-to-Many relation between the entities.

Resolution

As example we ran the following query: 

<<YourInstanceData>>/odata/v2/JobApplication?$select=applicationId,candidateId,firstName,jobOffer/offerApprovalId,jobOffer/relocationPack/picklistLabels/label&$expand=jobOffer/relocationPack/picklistLabels&$filter=(jobOffer/offerApprovalId ne null and jobOffer/relocationPack/picklistLabels/locale eq 'en_GB')

This is the response received:

We can confirm that all the locales are being returned, due to the ODATA limitation. 

As a suggestion you can review the section "How to handle one-to-many behavior" from the KBA 3087941 - One-to-many behavior in Integration Center

See Also

Keywords

RCM, recruiting, ODATA, API, Application, Picklist, PicklistLabel, values, Payload, requisition, offer, entities, entity, filter, returning, random, language , KBA , LOD-SF-RCM-API , Webservices & APIs , Problem

Product

SAP SuccessFactors Recruiting all versions