SAP Knowledge Base Article - Public

2148752 - How to extract Employee Central historical/future dated records using OData API

Symptom

You are trying to get data from SuccessFactors using OData API and it's not returning future or historical records in the output, only the recent time slice is being returned.

Environment

 SAP SuccessFactors Employee Central

Reproducing the Issue

The following query returns only a single record, the record which is currently active, and is not returning historical (past) and future dated records: https://<hostname>/odata/v2/EmpJob?$filter=userId eq 'EXAMPLE1'

Cause

OData by default sets the query as asOfDate, which returns only the records that are effective as of today. If you are looking for a record that is not active (that being because it's a historical record that is no more active, or because it's a record that has not been effectivated yet) then the filter explained below should be used.

Resolution

By using the filters below, you are able return multiple records, depending on the available information.

  1. fromDate
  2. toDate

FUTURE DATED RECORDS

HISTORICAL RECORDS (PAST)

ALL TIMESLICE

You might also like to retrieve all informations since a date, meaning that you only want to restrict the information FROM a date, and not TO a date. On this scenario you should use only fromDate parameter. This will allow you to return historical as well as future dated records.

See Also

fromDate and toDate (Date Range) Query

Keywords

OData API, future dated records, API, OData, future date, historical records, past, fromDate, toDate, EC, Employee Central , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , How To

Product

SAP SuccessFactors HCM suite all versions