A data source query can be sorted by a property and/or timestamp and in a given direction. For example, a library data source can be sorted by the “Name of a book” (i.e. property) and inDocumentation Index
Fetch the complete documentation index at: https://developers.notion.com/llms.txt
Use this file to discover all available pages before exploring further.
ascending (i.e. direction).
Here is an example of a sort on a data source property.
Sort object
Property value sort
This sort orders the data source query by a particular property. The sort object must contain the following properties:| Property | Type | Description | Example value |
|---|---|---|---|
property | string | The name of the property to sort against. | "Ingredients" |
direction | string (enum) | The direction to sort. Possible values include "ascending" and "descending". | "descending" |
Entry timestamp sort
This sort orders the data source query by the timestamp associated with a data source entry. The sort object must contain the following properties:| Property | Type | Description | Example value |
|---|---|---|---|
timestamp | string (enum) | The name of the timestamp to sort against. Possible values include "created_time" and "last_edited_time". | "last_edited_time" |
direction | string (enum) | The direction to sort. Possible values include "ascending" and "descending". | "descending" |