FlowmageDocs

Query database

BetaReads dataVersion 2

Finds pages in a Notion data source by filter and sort.

Settings

SettingWhat it is
ConnectionRequiredThe Notion connection the step signs in with.
Data source idRequiredNot the database id. The List data sources node turns a database id into the data source ids inside it.
FilterNotion's own filter shape, which is per property type and may nest with and / or. Leave it empty for every page.
Sort bylist of {property?: text, direction?: "ascending" or "descending"}
Only these propertiesPick the data source's properties, or type their ids. Leave it empty for all of them.
Include trashed pagestrue/false
Pages per call1 to 100 — Notion's own maximum.
Fetch every pageFollows Notion's cursor, and refuses past 5,000 pages rather than answering a short list.
CursorPaste a previous run's Next cursor to read the page after it.
Technical details
KeyValue
connectiontexta connection id from `requires.connections` (provider `notion`)
dataSourceIdtexta value from the vendor's own list
filterJsontext
sortslist of {property?: text, direction?: "ascending" or "descending"}, by default []
filterPropertiestexta value from the vendor's own list
includeArchivedtrue/false, by default false
limitnumber, by default 100
returnAlltrue/false, by default false
cursortext

Output

FieldType
pagesarray
pageCountPages in this answernumber
hasMoreMore pages are waiting behind this oneboolean
nextCursorCursor for the next pagestring
Sample output, and the expression for each field
  • hasMorefalse
  • nextCursor""
  • pageCount0
  • pages[]

Errors

When a step of this node stops a run, the run page shows a code. Look it up:

Example step

The step as a flow file holds it. Replace each value in <…>.

{
  "config": {
    "connection": "<connection id>",
    "cursor": "",
    "dataSourceId": "<data source id>",
    "filterJson": "",
    "filterProperties": "",
    "includeArchived": false,
    "limit": 100,
    "returnAll": false,
    "sorts": []
  },
  "label": "Query database",
  "type": "notion.queryDataSource",
  "version": 2
}

Older versions

A flow that already has this version keeps running it. A new step always gets the newest.

Version 1
SettingWhat it is
ConnectionRequiredThe Notion connection the step signs in with.
Data source idRequiredNot the database id. The List data sources node turns a database id into the data source ids inside it.
FilterNotion's own filter shape, which is per property type and may nest with and / or. Leave it empty for every page.
Sort bylist of {property?: text, direction?: "ascending" or "descending"}
Only these propertiesPick the data source's properties, or type their ids. Leave it empty for all of them.
Include trashed pagestrue/false
Pages per call1 to 100 — Notion's own maximum.
Fetch every pageFollows Notion's cursor, and refuses past 5,000 pages rather than answering a short list.
Technical details
KeyValue
connectiontexta connection id from `requires.connections` (provider `notion`)
dataSourceIdtexta value from the vendor's own list
filterJsontext
sortslist of {property?: text, direction?: "ascending" or "descending"}, by default []
filterPropertiestexta value from the vendor's own list
includeArchivedtrue/false, by default false
limitnumber, by default 100
returnAlltrue/false, by default false