Sorting

Trilium can sort the items of a list, a group of paragraphs or the rows of a table in a text note, comparing numbers, dates and times by their value.

Sorting

  • To sort, place the cursor in a list or a table, or select the paragraphs to sort, then press the Sort button of the Formatting toolbar to sort in ascending order. The arrow beside it offers Ascending and Descending. With the floating toolbar, the button is in the block-level popup.
  • When the selection covers several paragraphs, list items or table cells, the same choices are also in a submenu of the menu of the block handle (the sequence of dots to the left of the block), just above Delete, and in the right-click menu of the selection. The submenu is named after what it sorts: Sort blocks, Sort list items or Sort rows.
  • On the Mobile Frontend, the button is in the main row of the toolbar and in the row of the List › button.

A sort can be undone with Ctrl+Z.

What is sorted

  • List items: with the cursor in a list, the items at its level are sorted. Nested items move with the item they belong to and keep their own order. To sort only some of the items, select them.
  • Paragraphs and other blocks: select two or more paragraphs, headings, quotes, collapsible blocks or images. Each block is sorted by its first text: a collapsible block by its title, a quote by its first paragraph and an image by its caption. A selection that mixes a list with other blocks cannot be sorted.
  • Table rows: the rows are sorted by the column of the cursor, as described in Sorting rows in Tables. Inside a table cell, a list or several selected paragraphs are sorted instead of the rows.

Values are compared the same way as table rows, see How values are compared in Tables.

Limitations

  • The lines of a code block, or of a paragraph split with Shift+Enter, are not sorted one by one. A Code note can sort its lines, see Transforming text there.