How To Use Obsidian Dataview Plugin (Beginners Guide)

Jason Edward teaches how to set up Obsidian's Dataview plugin to query notes by metadata instead of folders. He covers installing Dataview, using YAML labels, creating templates with Templater, and building tables that sort notes by category, author, or date. The plugin lets you bulk-edit and filter without digging through folder hierarchies.
Chapters
Hello, Obsidian users. It's Jason Edward here. If you're new to the channel, I make videos on how to be more productive with Obsidian. And today we're gonna be talking about Dataview. Now, before we get started, it is important that you have got Dataview already installed. So what you wanna do is just go to your settings. You wanna scroll down to, uh, community plugins over here, and then just browse for the Dataview plugin. All right. So you wanna make sure that you install this. And then, um, once you've got it installed, I don't think there's anything you have to change over here, just make sure that these are turned on and you should be good to go. So today we're gonna be looking at Dataview for beginners and how you can start using Dataview and unlocking the full potential of your Obsidian vault. All right. So to get into this, we need to first understand what is Dataview. Okay. And the idea is Dataview is how you can collect your notes. So it's an alternative to the folder structure that most programs use. So this is kind of like the old way. This is why— this is how most softwares are set up. They have folders and then within those folders, there's more folders and it just goes in and in. Now the problem with this is that over time it can become very, very overwhelming. You can have too many different places for things and it just becomes hard to manage because if you want to access a certain file, you have to go all the way through digging through all of the folders. To find what you're looking for. Now, Dataview is a way for you to solve that. Okay. Because instead of this folder structure, what you can do with Dataview, and this is actually not a very good example, but it's the, it's the closest to what I could find. What you can do with Dataview is you can essentially query a specific type of note that you're looking for from anywhere in your vault. And it will return all of the notes that match that criteria so that you can then interact with them. So that's, that's one way of looking at it. You can see over here, we've got like search query crypto advertising, and then the keyword is crypto advertising. So essentially you're querying, you're querying a specific note you're looking for, and it's gonna return that type of note back to you. Um, another example is, let's say you've got, um, you've got students, you could create a main note that's just called student. And then that note would return the individual notes that are labeled as students. So, This is just a way of labeling information. All right. And I'm going to get further into this now. So hopefully you can kind of understand we've got the students and then Adam and Kesha are both students that fall under the student class, right? So by turning your notes into a database, it allows you to find what you need much faster and make changes to lots of files quickly. The cool thing with Dataview is that it allows you to sort your files by the time that you created them, the date that you created them by specific information within within the files. And overall, it just makes it so much easier to manage a large amount of notes. All right. So now that we've covered the introduction, let's get into some examples of labeling your notes. Now, the most simple example out there is let's say you've got 4 different, 4 different fruits. Okay. Now all of these fruits have something in common. They're all a category of fruit, but even though the type is different. All right. So how would this actually look if we were to create this inside of a Dataview query? Let me give you an example. All right. So as an example, created these 4 different notes and each one of them pertains to one of the fruits. So for example, fruit 1 is category type pear, and it just goes on and on for all of these, right? So now I can delete that. And what we can do with Dataview, now that I've created these notes, is I can then pull a query that has each of them in there. So you can see we've got the file, the specific note with a link to it, and then we've got the type of note that it is. All right. So you can kind of see, and then also the date that it was created. So this is what you can do with data view. You can actually put this into a table where you can then find your information no matter where it is in the vault. So these didn't have to be put into folders. There was no other structure besides simply just adding the following information. And now that I've given you that example, let's look at another one. So let's say you had some notes that you wanted to write about specific ideas. So you could give the category of ideas and then let's say you wanted to further break those down. So you could say the type is engineering, right? And then using data view, I could say, return me all the notes that are ideas that are also the type of engineering. And by doing that, I'd be able to find all my engineering idea notes right away without having to dig through different folders or manually have to create the folder structure for them. Same with books. If you have specific books that you want to put in Obsidian, like you could say the category is books. You could put the author's name and then you could put the genre. So if you wanted to find specific books with a specific author's name, you could do that. For example, with my books, if I just go here to my libraries, you can see here's all the books that I've already created notes on, and I didn't have to put them into a books folder. I don't have to worry about that. All I know is I want to create a new note. It's going to be a book note. And the next thing I'm going to show you now is how to actually use templates. So the thing is, you wouldn't want to manually type this out every single time that you create a note, right? You wouldn't want to have to like always enter this information. So that's where templates can come into play. In order to use templates, you first will need to download this specific plugin. So make sure you have this plugin. It is called Templater. All right. So this is how it's spelled, Templater. And once you've got it installed, it's gonna, it pretty much just works right out of the gate. So you don't have to worry about any of this type of stuff. Now that you've got it installed, let's say, all right, so once you've got your Templater plugin installed, I'm just gonna move myself back there. Now what you can do is start creating templates for the types of notes that you're gonna be creating over and over again. So if you have like constant idea notes that you're coming up with, what we can do is you wanna go here to your folder structure. Create a folder called templates. You can see I've already got a whole bunch of them in here, but you would create a new template, a new note called ideas template. And then all you do inside of here is just paste, um, the following, just like this. So, uh, this is called YAML structure where you put the three, uh, the three, um, hyphens, that's called YAML structure. And that's what allows Dataview to actually identify those specific things as labels. So this is kind of like meta information for your note. Now this is gonna be for ideas. So I'm also just gonna remove the type because I want it to be for any ideas that I have. I can very quickly just create this. And now that this is inside of my template folder, it's literally this easy. So, okay, um, one thing I forgot to mention with Templater, you do need to set your template folder location. So you wanna create a folder called templates and then set that as the folder. And then all you would do is let's say, I want to create a brand new note. And I know this is going to be an idea. So I could just say, um, million dollar idea, right? And then I want to use the template plugin. So I just hit Ctrl+E, which by the way is just a hotkey that you can set up. I just type in ideas template and there you go. Now I can start typing. So I could, I could put the type as business. and then I could just type whatever I wanted to in over here. And that's literally all it comes down to. So to give you a few more examples, I'll just move myself. So again, just to give you another example, let's say I want to create another note and I want this one to be a concept. So I'm just going to type in concept there. It's got the specific date. And then, um, there's also this, uh, this meta information called aliases. So aliases are like additional names that you can give to your notes. For example, let's say this is gonna be Test Note 1. And I can say in the alias over here, I can say example, example note. So now when I search for example note, it's gonna still link to Test Note 1. For example, if I just go example note, you can see Test 1 note. So that's how you can use aliases in your note. And that pretty much covers templates. So once you've got your, your foundational notes that you want to create, like I just showed you with the ideas, um, or books or anything like that, you literally would just go into your template folder. You create a template called books template, and then you just add the information that you need, like your labeling. So once that's done, then you can just start using that within your vault. And, uh, to cover the hotkeys, if I go to hotkeys, type in Templater, open the insert template modal is the one that I use. It's Alt+E, set up in my vault. So you could set this to whatever you want. And then whenever you need it, you just hit Alt+E, um, and then insert the template just like that. All right, cool. So now that you've created your templates, the next thing is using Dataview to actually create the different libraries for finding your notes. I've already shown you the example with my book notes. You can see here's where I just pull all the different books that I'm busy reading. And this puts them straight into a specific note. So I call this like a library note. So let's take a look at how you can actually create a Dataview query for yourself. If I wanted to create a Dataview query to find my books, all I would do is type in some apostrophes. Uh, I'm not sure if these are apostrophes or what it's called, but pretty much this symbol. Then you type Dataview. All right. On the next line, you're going to type table. And then over here, you don't even have to put anything here. I believe you could literally just leave it empty if you want, but again, it's just going to display the columns. So if you do have specific columns, like I know for the book one, I've got author. So I would just put that there. And then below that, um, I would just say where contains, and then category is books. And let's see if that works. Okay. So problem came up. All right, now we just have to see. And I'm actually glad this came up because this is sometimes what happens with programming is we need to make sure— all right, it said that expected one of the following. Okay, so the problem is simply that I put a space over there, and I shouldn't have put a space there. So there you go. I removed the space. And now it's actually displaying it correctly. And here's all of the different books that I've read. All right, and then it's also displaying the author information. Now, here's a good example of why this is so helpful, because we can see some of these don't have author information filled out. And this is because sometimes I've been lazy and I didn't have the— I didn't think about putting the author at the time that I wanted. But let's say I wanted to go back and actually like neaten this up a little bit and make sure that all of my information is consistent. Well, now it's very, very easy because all I do is I can find the specific ones where I haven't added the author. and I don't need to like look for them in, in some folder. I would literally just click on them, type in there. Um, you can see there's no author. I just put the author tag and then I'd say Brian Tracy. Then I go back and you can see now Brian Tracy has been added as an author for this specific note. So that's a good example of how data view works. And all you would do is just create your libraries folder over here. and then you would just start creating, you know, different notes pertaining to the specific templates. So I hope that you enjoyed this video. I know it was a little bit technical, but this is really what unlocks the power of Obsidian. And so I'm super excited for people to start using this and know more about how they can create these types of queries. And if you want to get access to this Dataview cheat sheet, it is available for download within my sample vault that you can get through my Patreon link. In the description below. That's where I share all of my insider information, where I can give you more personal support. I also have different, um, stuff that I'm creating all the time in Obsidian. For example, these are some code highlight blocks that I just created for my Patreon members. And this basically allows you to, yeah, like create highlights in your Obsidian. So I'm constantly adding more stuff to my sample vault, whether that be new templates, workflows, blueprints that you can use. And if you want to help to support this channel so that I can make better videos, then yeah, you can check out the link in the description to download that. That being said, thanks so much for watching this video on the introduction to Dataview. If you have any questions, let me know in the comments below, and I'll see you in the next video. Bye-bye.










