cancel
Showing results for 
Search instead for 
Did you mean: 

odata call - Filter condition not working - retrieving language based labels from PerEmail Entity

former_member539805
Participant
0 Kudos

Hey All,

I am trying to connect to the Successfactors system to retrieve email Information. Specifically - email address and email type.

I am selecting a couple of fields in PerPerson entity and then navigating to PerEmail.

emailNav/emailTypeNav

Now to get the Email type, I need to navigate to the picklist - ecEmailType, then to picklistLabels and select label. This field has the value 'business' or 'personal'. This is the value I need. The emailType field in PerEmail entity has the value 'B'. This is not something I can work with.

When I select label from picklistLabels, it gives me 3 records. For example:

"optionId": "17757",

"locale": "en_DEBUG",

"id": "44230",

"label": "Business",

"picklistOption": { "__deferred": { "uri": ................................................

"optionId": "17757",

"locale": "en_US",

"id": "44229",

"label": "Business",

"picklistOption": { "__deferred": { "uri": ................................................

"optionId": "17757",

"locale": "fr_CA",

"id": "44231",

"label": "Business",

"picklistOption": { "__deferred": { "uri": .......................................................

In the odata call I am using the filter:

&$filter=emailNav/emailTypeNav/picklistLabels/locale ne 'en_US'

to filter out only the english values. But it still retrieves all three records for the label.

Full odata call:

https://api4preview.sapsf.com/odata/v2/PerPerson?$select=customString3,personIdExternal,emailNav/ema... eq 'en_US'&$format=json

Note: I am trying these in Postman and they dont work

Accepted Solutions (1)

Accepted Solutions (1)

former_member185414
Active Contributor

Are you using OData V4? If not I don't think filter properties on child entities is supported while triggering with an expand call on parent.

Secondly put an external breakpoint and debug what values are coming to the CL_HTTP_EXT_BASE_HANDLER->IF_HTTP_EXTENSION~HANDLE_REQUEST

or FM /IWBEP/FM_MGW_HANDLE_REQUEST

* Also your URL mentions ne and eq at different places, do check that.

former_member539805
Participant
0 Kudos

I did not know that! I am using odata v2. Maybe that's why the filter doesn't work on the child elements.

About the URL that was a typo. I have tried with ne, eq, ne and eq, everything. It didn't work.

Let me use odata v4 and see the result. Will update you shortly. Thank you for the input.

Answers (1)

Answers (1)

Sriprasadsbhat
Active Contributor

Hello Kriba,

I dont see any problem with your query and you are using correct OData version but as per my understanding Filter works with only fields at first level, that's the reason you are getting all the records.

Regards,

Sriprasad Shivaram Bhat

mpothuganti
Explorer
0 Kudos

Hello Siva,

We are facing the similar issue.

Is there a way to handle this ? Any alternative approach to achieve the requirement please suggest.

Regards,

Manoj