🔵 🔵 🔵


Primary

၊၊||၊|။

DataviewJS ○˒|Definition|1st|20260516120153-00-⌔

DQL, JS and Inlines - Dataview#dataview-js

Dataview JS

The dataview JavaScript API gives you the full power of JavaScript and provides a DSL for pulling Dataview data and executing queries, allowing you to create arbitrarily complex queries and views. Similar to the query language, you create Dataview JS blocks via a dataviewjs -annotated codeblock:

```dataviewjs
let pages = dv.pages("#books and -#books/finished").where(b => b.rating >= 7);
for (let group of pages.groupBy(b => b.genre)) {
  dv.header(3, group.key);
  dv.list(group.rows.file.name);
}

Inside of a JS dataview block, you have access to the full dataview API via the `dv` variable. For an explanation of what you can do with it, see the API documentation, or the API examples.

**Advanced usage:** Writing Javascript queries is a advanced technique that requires understanding in programming and JS. Please be aware that JS Queries have access to your file system and be cautious when using other peoples' JS Queries, especially when they are not publicly shared through the Obsidian Community.

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •