Ordering
The results of a GET operation can be sorted using the $orderby query option.
- Accepts a property name and an optional sorting direction:
asc→ Ascending (default if omitted)
desc→ Descending
- Can be applied to comparable value types such as numbers, text, datetimes, and durations.
Examples
Sort by Description in descending order:
GET http://myserver:5181/odata/ServiceRequests?$orderby=Description desc
GET http://myserver:5181/odata/ServiceRequests?$orderby=ActualDuration desc, SourceID asc
NoteNote
- Currently, the REST API only supports ordering on first-level properties of an entity.
- Property names are case-sensitive and must match exactly (e.g.,
ID, notId).