cancel
Showing results for 
Search instead for 
Did you mean: 

CPI - EmpJob query fromDate and toDate

0 Kudos

Hello,

I'm building an iflow that will have to indicate when there was a job change from a static date in the past to the current date. I am able to retrieve the historical information from that date in the past, and the current information. In the CPI iflow, I am querying SuccessFactors via OData API, specifically the EmpJob entity.

The issue I'm having is that an employee could have more than one job change from the historical date and the current date, but I need to choose the first job change. I can query for all of the job changes by using the fromDate = 2019-11-24 & toDate = 2020-04-21 parameter, but if the record has multiple job changes, there will be multiple records pulled in by this query.

Is there a way in a CPI iflow to select only the earliest record? It would be something like the earliest startDate (field from EmpJob) among the records pulled, after the historical date. Is there a way to do this with a filter, or mapping, etc.?

Thanks,

Tyler

Accepted Solutions (0)

Answers (1)

Answers (1)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Tyler,

There are two options as per my understanding.

1) In your query use &$orderby=seqNumber desc and then select latest record having seqNumber.You might face issue if there are multiple changes to employment information on same day.

2) Write XSLT mapping to get the empJob having endDate 9999-12-31.

Regards,

Sriprasad Shivaram Bhat

john_barrow
Product and Topic Expert
Product and Topic Expert
0 Kudos

I'd agree with Sriprasad, I think the answer is to use a query that returns the one record you are looking for