Symptom
How to query both active and inactive users from the SuccessFactors instance in a single OData API query using User entity?
Environment
- SAP SuccessFactors HXM Suite
- OData API
Cause
By default OData API User entity won't return data for inactive users unless you explicitly specify in the query statement.
Resolution
A special filter condition on "status" field should be used with an "IN" operator and value as 't','f', which represents active and inactive respectively. This will make the query return data for all users, active and inactive.
One example would be:
https://apiX.successfactors.XXX/odata/v2/User?$format=json&$select=username,status,email,userId,firstName,country&$filter=status in 't','f'&$top=200
Note: If there are external users in the system then it is good to add this in the filter condition $filter=status IN 'active','active_external','inactive','inactive_external'. This will fetch all the internal and external User information, both active and inactive.
See Also
The guide page below explains User entity's behavior regarding inactive users.
Keywords
Inactive, users, user, entity, insufficient, permission, terminated, deactivated, query, select, data, blank, usernav, empty, null , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT , Integrations , How To