Skip to Content
0

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

Dec 18, 2017 at 09:07 PM

198

avatar image

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/emailTypeNav/picklistLabels/label,emailNav/emailAddress&$expand=emailNav/emailTypeNav/picklistLabels&$filter=emailNav/emailTypeNav/picklistLabels/locale eq 'en_US'&$format=json

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ankit Maskara
Dec 19, 2017 at 05:06 AM
1

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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.

0
Sriprasad Shivaram Bhat
Dec 20, 2017 at 08:02 AM
1

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

Share
10 |10000 characters needed characters left characters exceeded