How to query both active and inactive users from the SuccessFactors instance in a single OData API query using User entity?
- SAP SuccessFactors HXM Suite
- OData API
By default OData API User entity won't return data for inactive users unless you explicitly specify in the query statement.
A special filter condition on "status" field should be used with an "IN" operator and value as 'active','inactive' (or '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 'active','inactive'&$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.
The guide page below explains User entity's behavior regarding inactive users.
Inactive, users, user, entity, insufficient, permission, terminated, deactivated, query, select, data, blank, usernav, empty, null , KBA , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , LOD-SF-INT , Integrations , LOD-SF-INT-BOM , Standard SF to 3rd Party Boomi Content , How To