Skip to Content
0

odata v4 connectivity to Successfactors EC

Jan 23 at 02:14 AM

256

avatar image

Hey All,

Is there a way to connect to an SF EC using an odatav4 adapter?

I need to retrieve data, apply filter conditions and expand on multiple entities using odata apis. Using odatav2 this is really tedious since odatav2 does not support filtering on child elements. Odatav4, however, supports filtering on child entities and navigational entities along with lamda operation support like 'And' and 'All'.

All said and done, how do we actually use odatav4 to retrieve data from SF EC?

What will the url be? I am sure it's not - https://host-url.sapsf.com/odata/v2

Any help will be highly appreciated. Thank you.

Kriba

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

1 Answer

Best Answer
Eng Swee Yeoh
Jan 24 at 06:35 AM
1

I have only seen SuccessFactors Employee Central having OData v2. If the server only has V2, I don't think you can simply use a V4 adapter with it.

Regarding filtering on child element, you can achieve it on OData v2 too by using following filter format, it is not specific to only V4:-

$filter=childElement/childField eq 'value'

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

Oh! I was under the impression that when you are querying a parent entity and then you navigate from the parent entity to a child entity and query few parameters on the child entity using filter conditions, it doesn't work.

For example-

https://<<host-url>>.com/odata/v2/PerPerson?&select=personIdExternal,customString3,emailNav/emailAddress,emailNav/emailTypeNav/externalCode&$expand=emailNav,emailNav/emailTypeNav&$filter=emailNav/emailTypeNav/externalCode eq 'P'

So in this case I am querying the Parent entity and navigating towards the child entity and the filter condition is on the child entity. I have tried a couple of time with this and it doesn't work. It fetches all the records irrespective of the filter condition.

0

Hi Kriba

Not sure why it doesn't work for you, but such filtering on child entity fields work perfectly fine for me. Here are some screenshots from Postman:-

This is a query on parent entity WfRequest, with a filter on child entity's status field

https://<host>:443/odata/v2/WfRequest?$filter= wfRequestStepNav/status eq 'PENDING'&$expand=empWfRequestNav,wfRequestStepNav,empWfRequestNav/wfConfigNav

With status as PENDING, there are results returned.

When I change the value of the query field for status to a random value, the result set is empty.

This indicates the the filter condition on the child entity is being evaluated in the query call.

result1.jpg (64.2 kB)
result2.jpg (37.7 kB)
1

It hasn't worked for me either so I have a question - is the 'status' property in parent entity(WfRequest) as well ?

0

Ok let me try this out and get back to you. As far as the cases I have tried, this has failed.

0

Hi Kriba

I had a further check on this with other entities, and for the SF EC OData APIs which is on V2, it only works when the navigation is to a single entity instead of a collection. In other words, if the relationship is 1:1, then it works, if it is 1:N, then it does not.

Regards

Eng Swee

1

Hi Eng/Kriba,

And another (not so good) way to make it work is to expose the same property at the header level as well, provided the data model permits the same.

BR.

1

Hey Eng,

Ah yes. That makes sense. And that's why it wasn't working before. I was using a top down approach to navigate from PerPerson to PerEmail or EmpEmployment. Now, the problem with that is that the top down approach always gives you a 1:N cardinality and hence it didn't work. For example - one person having multiple Email or multiple Employment records.

I recently changed all the odata calls to use the Bottom up approach navigating from EmpJob or EmpEmployment to PerPerson. This is always a 1:1 cardinality and the odata filtering worked like a charm!!

Thank you Eng and Ankit for your valuable comments

Kriba

1