SAP Knowledge Base Article - Public

2166571 - How to query inactive users on User entity - OData API

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 '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.

See Also

The guide page below explains User entity's behavior regarding inactive users.

OData User entity - Supported Operations

Keywords

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

Product

SAP SuccessFactors HXM Suite all versions