Dataview Beginner's Guide - what can go wrong and how to fix it

Just published: The Beginner’s Guide for DATAVIEW Obsidian Plugin — 10 areas where things can go wrong and how to fix them. Would appreciate any feedback or questions.

06/16/2022 I’ve updated the article to include all the great feedback I’ve received on this forum and others. Thanks, everyone, for making this an even better tool for DATAVIEW beginners.

10 Likes

This is a fantastic resource and I’m sure I’ll be linking to it a bunch! One quick piece of feedback: a lot of people have been tripped up recently by the need to update community plugins like Dataview manually via the button in “Settings → Community Plugins”. Could you please add a reminder about manually updating (& then closing and re-opening Obsidian!) somewhere near the (delightful!) quoted line below? (I could imagine it fitting either before or after.)

Good grief — why aren’t my DATAVIEW queries working? :face_with_symbols_over_mouth:

Thanks!

By all means, I’d be happy to add that. I just want to make sure I’m clear. To confirm you asking that people be reminded to update their plugins via the setting ==> community plugin=> update plugging, and to close and reopen Obsidian. Correct, @scholarInTraining?

1 Like

Yes, a reminder to go to “Settings => Community plugins” then hit that “Check for Updates” button and then “Update” if it finds any! Dataview has had several updates recently, so if something isn’t working with a dataview query that is one of the first steps to check.

1 Like

Added. Thanks for the input.

1 Like

Thank you for this. Will you add an advanced version (include Tasks in Dataview)?

1 Like

Thanks for your faith in my abilities, but I’m afraid I’ve got a lot to learn myself before I do an advanced version. :grin: Maybe an advanced beginner version which I could include tasks.

2 Likes

Perfect. I will reveal my next wishlist upon its launch :blush:

2 Likes

From the post:

Field names are NOT case sensitive, but treat them like they are.

That last part certainly works as a rule! Some additional detail from the dataview documentation on fields, with an additional note that the field with spaces will only work “inline”, not in YAML:

If the field name has spaces, punctuation, or other non-letter/number characters, then you can refer to it using Dataview’s simplified name, which is all lower case with spaces replaced with “-”. For example, this is a field becomes this-is-a-field; Hello! becomes hello

So Dataview has two valid names for any field that contains capital letters, (1) the original name and (2) all-lower-case-with-dashes-instead-of-spaces-and-no-special-characters. So if your original field was ADDRESS:: 123 Somewhere, you can query by TABLE ADDRESS or TABLE address but not TABLE Address.
Personally, I like your rule of assuming everything is case-sensitive, since, as you point out, file and folder names are case-sensitive.


From the post, on sorting:

Note: the format says to use an expression. It makes more sense to me, when I put “field” there instead.

Yes indeed, a “field” is an “expression”, in fact the first in the dataview list. You can also do a computation on a field though, such as if you wanted to sort by last name instead of full name or sort by the US-state in the address (assuming they all ended with US-states! If not, it would be more complicated). Both of these examples are a little tricky to implement, but useful conceptually for thinking about “expressions” you could sort on.

@DeniseTodd Thanks for sharing this! Maybe the category should be switched to Share and Showcase. This way, the topic won’t be automatically closed.

Much appreciated!

1 Like

Great work! Thx for simple and comprehensive explanation. But I recently looked through various comments on discord and telegram groups, there is one more form of representation to task, list and table. It’s calendar, though I didn’t have need to try it myself, maybe you should mention that too in your article.

2 Likes

Thanks so much. Great feedback. I’m editing it now to make the case / two-word fields concept is more accurate. Regarding the field vs expression. I was attempting to put it into words a beginner might grasp easier! But I should make it clear. Thanks again.

1 Like

Per your suggestion, I have switched the category. I’m afraid that might break the link if someone had linked to it in the other category - but hopefully, they’ll be able to find it with a search. Thanks!

2 Likes

I’ll look into that. I haven’t seen that yet in the documentation from Dataview. I’ll research it and once confirmed, will add it. Appreciate the heads up. Thanks.

1 Like

You are welcome, @DeniseTodd. I just switched the category for one of my topics and tested existing links to it. They still worked. No need to worry about breaking the links.

Thanks again!

2 Likes

I found the official documentation on the “CALENDAR” option! I have added it to the article. Thanks so much for the info. Cool feature to track your progress on things.

Thanks, @DeniseTodd - I am a beginner with the Dataview query and your post is very helpful. I don’t see anything on exclusion like exclude a file name of a folder from a query, is it doable? I found some documentation but didn’t work…
I tried this to exclude the file name “T - Lead” but didn’t work. What did I miss?

```dataview
TABLE WITHOUT ID link(file.link, title) AS "Lead", status 
FROM #lead AND -"T - Lead"
SORT status DESC
Thanks!

@wpexpert, there could be a couple of things going on here.

1st - if file “T - Lead” isn’t in your root directory - then you need to add the full path. Let’s say it’s in your “Resource” folder - then it would say -
FROM #lead AND -“Resource/T - Lead”

2nd - check to make sure T- Lead is actually the name of the file - even the number of spaces before and after the hypen. Try copying the note name from the note itself and copying it into your DVQ
Let me know if those suggestions don’t work.

1 Like

Thanks @DeniseTodd ! You nailed it! It was inside 2 folders.
Here is my final query and it worked!

```dataview
TABLE WITHOUT ID link(file.link, title) AS "Lead", status 
FROM #lead AND -"Extra/Templates/T - Lead"
SORT status DESC
Thanks so much.
2 Likes

Excellent! So glad it worked!