Dataview / Get Dataview List
This action queries the optional Dataview plugin and returns the results of a DQL list query as a flat list of strings.
Dataview is an advanced topic that opens up a lot of possibilities for making sense of your notes and data. For information about DQL (Dataview Query Language), please see the related documentation on the Dataview site.
Pro Tip
Construct your queries directly in Obsidian and once you're happy with it, copy them into the action — you will save some time this way as the DQL debugging notices and error messages are more readable in Obsidian itself.
Examples
Please note: The examples will not explain the syntax of DQL (because the official documentation already does that well).
In my Obsidian note there is this DV query to get a list of notes tagged with #Actions-for-Obsidian
from my Journals/Daily
folder:
```dataview
LIST
FROM #Actions-For-Obsidian
WHERE file.folder = "Journals/Daily"
SORT file.name DESC
```
Outside of the editor mode, the result is a linked list of notes like this:
- Journal 2023-02-09
- Journal 2023-02-08
- Journal 2023-02-06
- Journal 2023-02-03
- Journal 2023-02-02
- Journal 2023-02-01
- Journal 2023-01-31
- Journal 2023-01-30
- Journal 2023-01-27
When the query is executed, Dataview constructs an Obsidian link for each hit and passes it to the renderer (Obsidian's Reading mode). So, under the hood, the above block basically looks like this:
– [[Journals/Daily/Journal 2023-02-09.md|Journal 2023-02-09]]
– [[Journals/Daily/Journal 2023-02-08.md|Journal 2023-02-08]]
– [[Journals/Daily/Journal 2023-02-06.md|Journal 2023-02-06]]
– [[Journals/Daily/Journal 2023-02-03.md|Journal 2023-02-03]]
– [[Journals/Daily/Journal 2023-02-02.md|Journal 2023-02-02]]
– [[Journals/Daily/Journal 2023-02-01.md|Journal 2023-02-01]]
– [[Journals/Daily/Journal 2023-01-31.md|Journal 2023-01-31]]
– [[Journals/Daily/Journal 2023-01-30.md|Journal 2023-01-30]]
– [[Journals/Daily/Journal 2023-01-27.md|Journal 2023-01-27]]
And that is pretty much exactly what this action will return: a list of Obsidian links, but without the bullet list prefixes.
If you use the same DQL query as the argument for the "DQL Query" parameter of the "Get Dataview List" action, you'll get the exact same list of strings.
And even if you change the query to add more data fields …
```dataview
LIST file.mtime
FROM #Actions-For-Obsidian
WHERE file.folder = "Journals/Daily"
SORT file.name DESC
```
… the output would still be a flat list of strings since that is what DQL's LIST
query returns:
– [[Journals/Daily/Journal 2023-02-09.md|Journal 2023-02-09]]: 2023-02-09 14:52
– [[Journals/Daily/Journal 2023-02-08.md|Journal 2023-02-08]]: 2023-02-09 10:07
– [[Journals/Daily/Journal 2023-02-06.md|Journal 2023-02-06]]: 2023-02-07 09:20
– [[Journals/Daily/Journal 2023-02-03.md|Journal 2023-02-03]]: 2023-02-06 09:58
– [[Journals/Daily/Journal 2023-02-02.md|Journal 2023-02-02]]: 2023-02-03 09:35
– [[Journals/Daily/Journal 2023-02-01.md|Journal 2023-02-01]]: 2023-02-02 08:59
– [[Journals/Daily/Journal 2023-01-31.md|Journal 2023-01-31]]: 2023-02-01 09:57
– [[Journals/Daily/Journal 2023-01-30.md|Journal 2023-01-30]]: 2023-01-31 14:23
– [[Journals/Daily/Journal 2023-01-27.md|Journal 2023-01-27]]: 2023-01-28 16:17
Use a built-in "Repeat With" block to loop over the results.