SAP Knowledge Base Article - Public

3399445 - The order of the records is incorrect in the OData API response - SuccessFactors OData API


  • You are expecting for the records to return in ascending or descending order in the OData API response. 
  • You might have (or not) used the $orderby parameter in your OData API query.
  • Only records of the starting entity are returning in expected order.


  • SAP SuccessFactors HXM Suite
    • OData API

Reproducing the Issue

  1. You are running a query for any entity, EmpJob for example. 
  2. And you are performing navigations to other entities as well. 
  3. However, when querying, in the response the records are not returned in the expected order.


The system query option sorts the starting entity only. Child entities aren’t sorted. When using $orderby on navigation records, they are not sortable. 


This is expected behavior. 

The query no matter how built, it does not guarantee the order of navigation records at a framework level, and we do not override the mentioned method to fix the order, so we can confirm that navigation records are not sortable.

If you had a response where the order was correct and then another response where it was no longer correct, it can return in correct order occasionally because the data recorded in database is occasionally in the desired order. If one of the records is modified, the position in database will be changed so you will not see the result in desired order anymore.

See Also

$orderby | SAP Help Portal


ascending, descending, orderBy, records, navigation, child entity, root entity, predictable. , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem


SAP SuccessFactors HXM Suite all versions