Skip to Content

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Dec 19, 2017 at 05:06 AM

    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.

    Add comment
    10|10000 characters needed 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.

  • Dec 20, 2017 at 08:02 AM

    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

    Add comment
    10|10000 characters needed characters exceeded