Symptom
When you execute a query using queryMode=snapshot to retrieve only the current record for the given snapshot_date value, but the response returns
Complete picture of all the Employee's data as it was on the snapshot date including all changes, corrections, and deletions.
e.g.
Query : where snapshot_date = to_datetime('2021-07-28T00:00:00')
<queryString>SELECT person, personal_information, employment_information, job_information FROM CompoundEmployee WHERE snapshot_date = to_datetime('YYYY-mm-DDTHH:MM:SSZ') AND person_id_external = (*)</queryString>
<urn:param>
<urn:name>queryMode</urn:name>
<urn:value>snapshot</urn:value>
</urn:param>
Response :
You receive in the response historic records for in job_information as example even if the lastmodifiedOn value for these records are before the snapshot_date = to_datetime value in your query
- Query above is using queryMode=snapshot with value snapshot_date = to_datetime('2021-07-28T00:00:00Z'), however records returned are those whose lastModifiedOn is before the snapshot_date value.
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."
Environment
SAP Successfactors HXM Suite
SAP SuccessFactors Employee Central
- Employee Central Compound Employee API
Cause
Misunderstanding on the Behavior for Snapshot Mode Query. Snapshot Mode Response, will return complete picture of all the Employee's data as it was on the snapshot date including all changes, corrections, and deletions.
Resolution
To extract only the time slices valid on a given date (applicable only for effective-dated information), The correct parameter and mode to use is
- standard mode for query
- with effective_end_date filter on the WHERE Clause
E.g.
<queryString>SELECT person, personal_information, employment_information, job_information FROM CompoundEmployee WHERE effective_end_date = to_date('YYYY-mm-DD') AND person_id_external = '*'</queryString>
See more information for this WHERE Clause parameter in the Guide : >> Effective End Date Filter Link <<
See Also
2307099 - How to use snapshot mode in Compound Employee API
Employee Central Compound Employee API Guide Link > Section Snapshot
Keywords
queryMode=snapshot, snapshost_date=to_datetime, effective_end_date, compoundEmployee API, effective-dated information for compoundEmployee API, effective_end_date filter , KBA , LOD-SF-INT-CE , Compound Employee API , LOD-SF-INT , Integrations , How To