Order By Properties
| Name | Type | Default | Description |
|---|---|---|---|
columnId | string | Required | Dot-separated property path to the column to sort by. Must reference a valid property in the entity type |
direction | string | "asc" | Sort direction: "asc" (ascending) or "desc" (descending) |
Configuration in Sheet YAML
Sorting is configured in two places within the sheet configuration:Global sortBy Section
The top-level sortBy array defines the default sort order applied when the sheet loads:
Column-Level sort Property
Individual columns can specify their own default sort direction:
| Name | Type | Default | Description |
|---|---|---|---|
sort | string | None | Default sort direction for this column. Values: "asc", "desc" |
Sort Behavior
Client-Side Sorting
- Sorting is applied on the client side after data is fetched
- Multiple column sorting is supported and follows the order specified in the
sortByarray - If
directionis not provided, the default is"asc" - The configured
sortByis always appended after user-initiated sorts to maintain a stable hierarchical order
Interactive Sorting
Users can sort interactively through:- Column header click — toggles sort direction on a single column
- Ctrl+Click on column header — adds to existing sort criteria for multi-column sorting
- Toolbar sort controls — additional sorting options from the toolbar
Column Type Sort Behavior
| Column Type | Sort Behavior |
|---|---|
| Text | Alphabetical sort |
| Number | Numeric sort |
| Enum | Sorts by enum value sequence, not alphabetically |
| Reference | Sorts by the display value of the referenced entity |
| Custom render | Sorts by the rendered display value |
Enum columns sort by the defined enum sequence, not by the string label. This ensures that priority levels like Critical > High > Medium > Low sort in the expected logical order.
Validation
Order-by property paths are validated against the entity type metadata at query execution time. The validation ensures:- Each property path references a valid property in the domain model
- Navigation paths (dot-notation) resolve to valid property chains
- Invalid property paths produce validation errors
Query-Level Order By
In the query API, order-by clauses use property path strings with an optionaldesc suffix:
Multi-Column Sort Example
outlineNumber ascending, then by priority descending for items with the same outline number, and finally by title ascending as a tiebreaker.
Complete YAML Example
Related Pages
- EntityQuery — top-level query containing the orderBy clause
- Sort By — YAML
sortByconfiguration reference - Sort and Filter — interactive sort controls in the UI
- Column Properties — the
sortproperty on individual columns
Sources: KB: sortBy Configuration Guide | Code: OrderByClause.java, sorting.spec.ts, mip_undo_redo.template.yaml, powersheet.yaml
Sources
Sources
KB ArticlesSource Code
OrderByClause.javaprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/common/types/api/document.tsprod-powersheet-src/com.nextedy.powersheet.client/src/modules/QueryManager/QueryManager.tsxprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/cypress/e2e/Sheet/reference.spec.tsprod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/mip_undo_redo.template.yaml