Symptom
You noticed your API query is returning data for inactive employees even though you are not using the filter "status in t,f".
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
- OData API
Reproducing the Issue
- Run a query similar to this: https://api68sales.successfactors.com/odata/v2/User('cgrant')?$select=userId,firstName,lastName&$format=json
- Assuming employee "cgrant" is inactive, and since no status has been informed in the filters, no data should return on the response.
- Response is returned normally, as below:
Cause
API query using Key Predicate, hence it will query the database for all statuses.
Resolution
As explained in the OData Reference Guide, it works like this:
Querying users by key predicate
When a key predicate is used, the query will return the matching entry regardless of user status. Below is an example of querying a user by key predicate:
https://<API-server>/odata/v2/User('cgrant')?$format=JSON
See Also
Keywords
inactive employees, status, User, active employees, key predicate, status 't,f', external employees. , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem
Product
Attachments
Pasted image.png |