Queries Dataview and returns the results of a DQL list query as a flat list of strings.
This action requires the Dataview community plugin in Obsidian. For information about DQL (Dataview Query Language), see the Dataview web site.
Parameters
Vault
The vault to work in.
Type: Vault reference
DQL Query
Type: Text
Return Value
Text (list)
About Dataview
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.
Examples
Please note: The examples will not explain the syntax of DQL (because the official documentation already does that well).
In my Obsidian note I have this DV query to get a list of notes tagged with #Actions-for-Obsidian
from my Journals/Daily
folder:
In Obsidian's Reading 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:
And that is pretty much exactly what this action will return: a list of plain-text 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 …
… the output would still be a flat list of strings since that is what DQL's LIST
query returns:
Screenshot:
Use a built-in "Repeat With" block to loop over the results.
Pro Tips
If you are not interested in the note link, check out the LIST WITHOUT ID
variant of the query.
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.
Related Links
- Search the Actions for Obsidian community forum for "Get Dataview List"