I’ve just started with dataview. I made a table that should pull books with “Book” in the YAML field “Type”, but the table only pulls 3 of the 8 notes is should pull … I will have many more book notes in the vault if I can make this work :). This is my table code:
TABLE People, Status, Detail
WHERE Type = "Book"
Things I have tried
I have checked the notes that are not appearing to be sure they have “Book” in that field.
I have searched help and forums to see if the pull is being limited to 3 notes as a default and I need to add a “limit” parameter of “all” or something.
A few unrelated questions:
If I put a link in a YAML field, it appears in the table not as a link style, but indented with a bullet which looks weird. Is there a spec I could add that would change this? If not, I guess I will not use links in the metadata, at least for author.
Is there an easy way to reduce the size of the table content so that more columns will fit?
I have been keeping info on things like books in databases in Notion. I’m trying to see if I could move this data to Obsidian. The Notion tables present more cleanly, with the ability to narrow columns and scroll left to right.
Is the part you posted in your YAML section, or in the main body of the note?
(By the way, when posting from your vault, it’s a good idea to start and end the block with four backticks (````). That will help make sure the forum doesn’t mangle the formatting.)
OK, I can see more clearly now. Thanks for posting an example.
Your YAML block has some issues. YAML frontmatter fields are formatted differently than Dataview inline fields.
First, YAML fields should only have one colon. Your “Date_Note” field has two.
Second, links should be enclosed in quotes, e.g. "[[Henry Adams]]" rather than [[Henry Adams]]. This is because brackets have special meaning in YAML, used to define lists.
Third, your Detail field should either be surrounded by quote marks or else have commas between each item, e.g. either:
Can I ask… using Detail: "[[History]]", "[[Philosophy]]", "[[American History]]", "[[@ Dad]]", "[[President]]" reads as invalid YAML. The values do work if arranged as a sequence. Or am I doing something wrong?
Thank you so much for your attention with this. Putting quotes around the bracket links cleared up the problem with how that content displayed in the table. I revised that situation across all the books and removed the second colon in the Date_Note field. This made one more book appear in the table, but still not the other few. For instance this:
One way to verify/locate your faulty YAML is to copy --- into your clipboard, and then try ending the frontmatter at various places to see where it doesn’t accept your markup.
So try adding the --- first in the middle of your frontmatter list, if it’s OK when switching to reading view, then move it further down. If it’s still invalid, then move it up. With a few insertions like that you’ll locate the offending line(s), and can start working with correcting it.
Ah, I misread those directions; I thought brackets around all the multiple links was an option if you want the items to appear in a list as opposed to separated by commas. Adding the brackets did indeed fix the YAML. I guess the list format is necessary. And thank you for the tip of switching to reading mode to check the YAML syntax.
I truly appreciate all of your help with this. I finally have a successful handhold on dataview!
Another way is to use the option to move the --- line up and down using hotkeys, and having the same note loaded in one side-by-side pane in source mode, and in the other pane in read mode. Helps to see immediately if the YAML is invalid at a certain line.
Don’t know if there are default hotkeys for this, but I use: