obsidian-dataview
obsidian-dataview copied to clipboard
support markdown tables as data sources
A regular markdown table
| name | foo | bar |
| - | - | - |
| something | 1 | |
| something else | 2 | 123 |
that renders as
name | foo | bar |
---|---|---|
something | 1 | |
something else | 2 | 123 |
can be made accessible through the api. may be something like
```dataquery
table i.name as Name, i.foo as Foo, i.bar as Bar
FROM ...
FLATTEN file.items as i
```
I think the only hard part of this is coming up with the syntax for specifying what Markdown table you want to load from.
cooperate and do it with cooperation with the advanced. table plugin people?
That plugin is for table manipulation is it not? I'm more referring to how mechanically the source should look like. I.e., maybe by taking the first table under a header?
TABLE FROM mdtable([[Page#Header]])
well, even just 'first table in the file' would already be great. but now that you have header queries, that seems like the right direction.
This would be a realy awesome feature for this already very cool plugin :)
+1
I think the only hard part of this is coming up with the syntax for specifying what Markdown table you want to load from.
Obsidian already supports the following:
[[My Note#^my-table]]
Where ^my-table
should be put under the table in question.
Maybe it could be used.
It can also just be an array of tables, so something like: p.tables[2]
Block references would also work, that is a good idea. I'll make the data available in the index (as file.tables
) and see if I can make it possible to query by the block ID.
You could possibly take a peek at how the Dice Roller plugin does it, it lets you pick a table to roll from by specifying table's block ID
Was just playing with obsidian-tracker
, which can work on tables, and came here to see if I could use dataview to query a table to return just a subset of the table (think a constantly growing activity log, and wanting to just show the day's activities in the Daily Note).
Looks like pulling from tables with DataView is not available yet, but this ticket gives me hope it will be someday..
Block references would also work, that is a good idea. I'll make the data available in the index (as
file.tables
) and see if I can make it possible to query by the block ID.
What's the status on this? I'd love to experiment with dataview in order to query my inventory database :-)
cooperate and do it with cooperation with the advanced. table plugin people?
I think Notion-like Tables must have something like this under the hood, right?
I also give this feature a +1. In my daily notes, I use markdown tables to keep track of my daily habits. I'm thinking I could have a page to parse my habit logs with the hopes of displaying some sort of "don't break the chain" / summary idea.
Hmm I wonder how difficult this is. Obsidian does parse tables so wonder if we could leverage that somehow.
Just coming by to add my +1 to this as a useful feature. I'm writing up a table of my home network and would love to query it to pull the IP into sub-pages.
That would be a relly nice feature, +1 to this for sure!
+1. My current workaround is to use lists with inline fields. It’s more verbose syntax, but also more flexible.
Since the markdown tables got a boost with the 1.5 update, supporting the tables directly as a data source would be a very good addition by Dataview.
The update does not bring table indexing to the metadata cache which means we'd still have to parse tables by hand. Given that this plugin is in maintenance mode, it is unlikely it will be added.
+1 to this issue. An idea I have a use for this feature would be having a table of expenses in my daily notes, that I can tally up in a monthly note for budgeting.
+1 This would be very useful to query manual data with.