Queries Dataview and returns the results of a DQL table query as a nested list of strings, i.e. a list of list(s) of strings.
Returns a list of Dataview table rows. Use Shortcuts' built-in "Repeat with Each" action to iterate over the result. The contents of each row can be accessed using the "Columns" field of the Dataview table row (i.e., the Repeat Item), which is a 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
Dataview Table Row reference (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
Let's take a look at the query examples as found in the DQL TABLE
query documentation.
The query specified three return fields: started
, file.folder
, and file.etags
. However, by default, each returned row will contain four fields: the note link, followed by the three fields specified in the query.)
File (3) | started | file.folder | file.etags |
---|---|---|---|
League of Legends | May 16, 2021 | Games | - #games/moba |
Pillars of Eternity 2 | April 21, 2022 | Games | - #games/crpg |
Stardew Valley | April 04, 2021 | Games/finished | - #games/simulation |
This is also what the action will return: a list of table rows, i.e. a list of a list of strings.
If you use a built-in Repeat with Each action with this actions result, each iteration will return a Dataview Table Row object. That object has a property "Columns", which holds a list of strings, i.e. this row's fields.
Pro Tips
If you are not interested in the note link, check out the TABLE 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 Table"