SAP Knowledge Base Article - Public

2359742 - How to use $count / How to verify the output records in an Odata API call?

Symptom

How to count or verify the no.of output records through Odata API

This is helpful to troubleshoot or investigate issues with missing records in the output file.

Environment

Successfactors

Resolution

Append /$count after the root entity in an Odata API query call.

Example shown below.

API Request

/odata/v2/EmpEmployment/$count?$expand=personNav/personalInfoNav,personNav/emailNav/emailTypeNav,jobInfoNav/companyNav,jobInfoNav/businessUnitNav,jobInfoNav/costCenterNav,jobInfoNav/divisionNav,jobInfoNav/locationNav,jobInfoNav/emplStatusNav/picklistLabels,jobInfoNav/employeeClassNav/picklistLabels,jobInfoNav/managerUserNav,jobInfoNav/employmentTypeNav/picklistLabels,personNav/phoneNav/phoneTypeNav,userNav&$filter=personNav/personalInfoNav/firstName%20ne%20null&$orderby=personNav/personalInfoNav/firstName

API Response

25121

Screenshot of the same.

25121.png

Similarly,

/odata/v2/User/$count

This gives the output of number of active users in the SF instance.

 

Keywords

usage of $count , KBA , LOD-SF-INT , SF Integrations - EC Payroll, Boomi/ HCI, API , LOD-SF-INT-API , SF API & Adhoc API Framework , How To

Product

SAP SuccessFactors HCM Core all versions