cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Odata API Retrieve Delete records and changes to the history records

VigneshR
Discoverer
0 Kudos
2,733

Dear SAP team,

We are working on the data extraction from SuccessFactors to Snowflake and using ODATA API services.

We have explored options retrieving the data using ODATA API but unfortunately the below two scenarios is not supported.

1. Retrieving deleted records using ODATA API.
2. Delta changes that has happened in the history records.

1. For initial Load we are using the fromdate and todate filter as 01.01.1900 to 31.12.9999.
https://apisalesdemo2.successfactors.eu/odata/v2/EmpJob?$filter=fromDate=1900-01-01&toDate=9999-12-3...

2. To retrieve delta as of today the OData we are using fromdate and todate filter as todays date and lastmodifiedon last job run date.
https://apisalesdemo2.successfactors.eu/odata/v2/EmpJob?$filter=fromDate=2023-03-23&toDate=2023-03-2... ge 2023-03-22

3. To retrieve delta along with future dated record we are using the filter fromdate as todays date and last modified date greater than last job runs date.
https://apisalesdemo2.successfactors.eu/odata/v2/EmpJob?$filter=fromDate = 2023-03-23&lastModifiedOn ge 2023-03-23

Could you please help us with the resolution or workaround to retrieve deleted records and changes to the history records.

Also please let us know if there are any customers who have handled similar scenario and resolution to it.

Regards,

Vignesh. R

Accepted Solutions (0)

Answers (1)

Answers (1)

nlgro02343
Active Contributor

1st issue cannot be resolved with odata, as it doesn't support deleted records. Please use the SFAPI (compoundemployee) API for deletes (this is a SOAP API, in some ways also better to use as you get multiple entities at once) as that's what most customers do.

In terms of your queries, keep in mind that you will miss some records (at least futured dated ones) if you write it like this:
https://apisalesdemo2.successfactors.eu/odata/v2/EmpJob?$filter=fromDate=2023-03-23&toDate=2023-03-2... ge 2023-03-22

Something like the following is more common:
https://apisalesdemo2.successfactors.eu/odata/v2/EmpJob?$filter=fromDate=1900-01-01&toDate=9999-12-3... ge 2023-03-22
Else you don't get backdated records and/or future dated records (which customers often also want changed). The odata api by default shows records as of today (which if sufficient, could be a reason to even drop fromDate=1900-01-01&toDate=9999-12-31 )