Symptom
You see a discrepancy in the number of users when retrieving users in a Permission Group using the function import getUsersByDynamicGroup via OData API.
The count of users (if activeOnly=true) doesn't match the count of activeMemberCount field in the DynamicGroup entity.
The total number of users in the group (if activeOnly=false) also sometimes doesn't match the totalMemberCount field count in DynamicGroup entity.
Environment
- SAP SuccessFactors HCM suite
- OData
Reproducing the Issue
You triggered the below API query:
https://<api_endpoint>/odata/v2/getUsersByDynamicGroup?groupId=1672L&activeOnly=true&$format=json
The above query returns the users who are active and belong to the groupId 1672. As in the above API query activeOnly=true is mentioned it will return only active users. If activeOnly=false is mentioned it returns both active and inactive user.
In the API response you can see that user count is less as compared to the total activeMemberCount in the DynamicGroup.
e.g. Scenario: activeMemberCount: 120635
And the users returned via the getUsersByDynamicGroup entity are 120631.
From the total count of 120635 users, 4 users were not returned in the API response of the getUsersByDynamicGroup.
Cause
The reason for not receiving these 4 users in the API response is the users don’t have their employment information maintained.
If the employment information does not exist for users, they will not be returned in the API response of the getUserByDynamicGroup.
Resolution
This is an expected behavior by the getUsersByDynamicGroup function import.
The users who are not returned via the API are the users for whom the employment information is not maintained. As the employment information is not maintained for this user, they are not returned in the API response.
getUsersByDynamicGroup returns a list of all the users that have employment information and belong to a specific permission group.
activeOnly - If the value for this parameter is True, the function returns a list of all active users who have employment information. If the value is False the function returns a list of all users (active and inactive users) who have employment information. If the value is empty, the value defaults to false and a list of all users who have employment information is returned.
Kindly ensure that all the users who are added to the DynamicGroup are users who are created properly and have the employment information maintained to receive all the user in the API response.
See Also
Keywords
getUsersByDynamicGroup, DynamicGroup, groupId, activeMemberCount, totalMemberCount, Dynamic, Group, Employment Information , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem