Define a Single-Column Sort
Add asortBy array at the top level of your sheet configuration. Each entry specifies a columnId and optional direction:
| Property | Required | Description | Default |
|---|---|---|---|
columnId | Yes | Dot-separated binding path to the column to sort by | — |
direction | No | Sort order: "asc" (ascending) or "desc" (descending) | "asc" |
columnId value must match a binding path defined in your columns section.
Define Multi-Column Sort
Multiple entries in thesortBy array create a multi-column sort. Rows are sorted by the first column, then ties are broken by the second, and so on:
Sorting is applied on the client side after data loads. The sort order specified in
sortBy defines the initial view — users can change it interactively from the toolbar.Sort by Navigation Properties
You can sort by columns that use navigation binding paths (columns bound to related entities):columnId must be the exact binding path used in the columns section.
Per-Column Sort Property
Individual columns also support asort property that defines a default sort direction for that specific column:
Interactive Sorting
Users can interactively sort by clicking column headers. Powersheet supports these sort interactions:- Click a column header to sort by that column (toggles ascending/descending)
- Ctrl+Click a column header to add it to the multi-column sort chain
- Column headers display a visual sort direction indicator when active
sortBy is always re-applied after user-initiated sorts to maintain hierarchy stability.
Complete Example
Verify
After saving the sheet configuration, reload the powersheet document. You should now see rows ordered according to thesortBy configuration. Column headers of sorted columns display sort direction indicators.
See also
Sources
Sources
KB ArticlesSource Code
prod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/whole_rtm.template.yamlprod-powersheet-src/com.nextedy.powersheet.client/cypress/fixtures/configurations/mip_undo_redo.template.yamlprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/packages/sheet/commands/sort-reset.tsprod-powersheet-src/com.nextedy.powersheet.client/ltc-repo/cypress/e2e/Sheet/sorting.spec.tspowersheet.yaml