If you are new to Dataview, and you are considering using it, I would highly, highly recommend you use it through using DB Folder.
And if you are not new to Dataview, and have been using it for a while, like me - I would also highly, highly recommend using it through DB Folder. (More advanced users please feel encouraged to share your take on this, if you should disagree.)
WHAT IS DB FOLDER?
DB Folder is a community plugin built on top of the Dataview community plugin, that does two things: It makes working with Dataview a lot easier and more inutitive, and it provides additional functionalities. (Which may be possible to achieve with Dataview using Java Script, I am not qualified to tell.)
Specifically, it provides the following:
- A “What you see is what you get” user interface for Dataview table queries.
- It supports you in fine tuning the look of your table, by easily changing things like: column width, column order, text size, text alignment, text wrap around, etc. etc.
- The option to edit what is shown in a table view from within the table view. (= Changing the value of properties in the corresponding notes.)
- The option to add new, and delete existing properties together with their values from notes, from within the table view. (The new property only gets added to the corresponding notes when you actually populate them with values.)
- The option to create new notes from within the table view.
IN WHAT WAY IS IT A WYSIWYG INTERFACE?
If I want a column to be wider or narrower, I can just drag the corresponding separation line.
If I want to change the order of columns, I can just drag and drop a column to the left or the right, and drop it wherever I want it to be.
If I want to filter for something, I can just type the thing I want to filter for in the corresponding search field on top of that column, and I can choose the needed operators at my disposable (like =, !=, <, >) from a menu.
For example, I could hide all scenes that don’t contain a certain character.
If I want the text to be smaller, I can just move a slider.
If I want to temporarily hide a column, I just click on the column header, and choose “hide”.
WHY DID IT FEEL LIKE SUCH A RELIEF WHEN I FIRST STARTED USING IT?
Yes, Dataview itself isn’t all that hard to learn.
And yet, I can’t count the amount of times dataview made me swear, because I made some stupid syntax mistake.
I had none of these problems with Database Folder.
Then there is the formatting thing. While this may just sound like a little bit of extra sugar added, it can make a huge difference for the usability.
No need to create and load CSS snippets for wrapping text, all it takes is to tick the option. (Each column can be formatted individually.)
TO WHAT EXTENT DOES IT MAKE IT UNNECESSARY TO DEAL WITH DATAVIEW AT ALL?
For my present use cases, it makes it unnecessary to learn the Dataview syntax.
The one (partial) exception is the following:
When I set up a database folder, I need to tell it which notes to use.
I can tell it to use all the notes in a folder.
It also offers the option to use a dataview query for this, when the notes you want to have in your table are not all neatly inside one folder, or all tagged with one tag. There it is useful to know how to write FROM and WHERE clauses. This only needs to be done once, when you set it up.
(In my cases, all I needed to enter was something like
WHERE type = “scene”
How can I…
…HIDE OR SHOW A COLUMN, AKA EXCLUDE OR INCLUDE AN EXISTING PROPERTY IN MY NOTES FROM BEING DISPLAYED IN THE TABLE?
Click on the + icon on the top right, scroll all the way down the dialogue filed that pops up and toggle on or off which properties you want to see displayed.
For hiding, you can also click on the column header, choose “Hide” from the pop up menu.
This is possible after the initial setup, which I describe further down below in the Step by Step guide on how to set up your first DB table for a sub group of your existing notes.
…ADD A NEW PROPERTY TO THE NOTES DISPLAYED IN THE TABLE?
Click on the + icon on the top right, and use the “Add new property” dialogue. The property only gets added to the corresponding note, when you enter an actual value.
…DELETE A PROPERTY, TOGETHER WITH ITS VALUES, FROM ALL NOTES DISPLAYED IN THE TABLE?
this is one of the basic settings. Be careful when you toggle this on, because it means that when you delete a column from your DB table, the corresponding properties and their values will get deleted from the notes shown in your DB table.
WHAT ARE SOME KNOWN HICK-UPS / TROUBLES THAT OCCUR WHEN USING DB TABLE?
It often doesn’t auto update the way you would expect it to.
For example, when you set up “Selection” options (for example, 1,2,3,4,5 stars to choose from in a rating property), it will only show you the added choices when you click away into another note, and then back once.
STEP BY STEP GUIDE HOW TO CREATE YOUR FIRST DB TABLE FOR YOUR EXISTING NOTES.
Install and enable the Dataview plugin.
Make sure that
- Enable Inline Queries
are all toggled on.
Install and enable the DB Folder plugin.
Go to settings. These are the default settings when you create a new DB folder. They can always be overruled by the setting for each individual DB folder, which you can set after you created it.)
In my case, I chose the following settings:
- pagination size: 40 (how many rows, before a new page gets created. If you crank them all up to 200, all of your scenes get displayed on one page. The downside is that this might take a little longer to load.)
- font size: 14
I have toggled on the following:
- row shadow
- show footer
- Default media link state
- Default link alias state
- Auto update
Everything else is toggled off.
Media dimensions (for when you display images) I have set to 140 x 140.
Now it’s time to create your first DB table.
Fot this, you need to decide which notes you want to see displayed in the DB table you want to create.
For example, if you are building a story database, you may want to start with a DB table for all your notes of type “scenes”. (With the possibility to filter some of them out later, occasionally, when ever needed.)
Later, you may also want to create DB tables for all notes of type “character” and all notes of type “location”.
If your scenes are all in a folder, you could just place your DB table inside that folder, and use the option “current folder” under “Select Source”. (Which automatically includes all sub folders.)
If you gave all your scene notes the type “scene”, I would recommend to use this to identify the notes you want in your DB tables. In this way, you always have the option to move the scene notes to a different folder, when needed.
Click on the “Create a new database Icon”, that appeared in your ribbon, after you installed and enabled DB Folder.
Choose a name. Maybe something starting with an underscore, or a 0, if you want the DB table to always appear on top of your Scenes folder.
For “Select source”, chose “Dataview query”.
Under Dataview query, enter
WHERE type = “scene”
For “Select destination folder”, type in the path of your Scenes - Folder.
Click on create.
What should happen now, is that you should have a table with one column, with all of your scenes in it.
Add all the properties you want to see displayed in your DB table, by doing the following:
Click on the + Icon on the top right.
A dialogue window pops up.
Where it says “select an existing column to add”, click in the first empty field.
You should now see all of your scene properties pop up, to select from.
Chose one after the other, and click on the pencil icon once.
(You probably don’t need “type”.)
After you have done this, all these properties got added as colmuns to your DB table.
When you click + again, you can now see them at the bottom of the dialogue window, if you scroll all the way down. Where you can easily toggle them on or off.
Time to format your columns.
To do this, click on the column header, and choose “settings”.
Personally, so far, I have alwas chosen left align, top align, and wrap around for all of them.
(Wrap around makes the text break to the next lines.)
After you have done all this, try if you can do the following:
- change the order of columns, by clicking the header of one column, and dragging it to the left or the right
- make columns wider or narrower, by hovering over the separation line until the <|> icon appears, and clicking and dragging
- enter text into cells, by clicking them, until another rectangle appears, then pressing ENTER
- if you want to enter text into list properties, use this format: [word1, word2, word3]. If you want to enter Links instead of words, this should look like this: [[[note1]], [[note2]], [[note3]], [[note4]]]. (After you entered them, DB Folder will replace them with the full path.)
- I often use links, and lists of links, as values of properties. I know how to make regular text smaller, but I don’t know how to do this with links. Anyone know how to do this?
- I have quite a few more open questions, but I am too lazy to type them out right now. I may add them to future updates.
There is obviously lots and lots that needs to be added, this is just a beginning.
Very happy for any suggestions for cool tips & tricks you have figured out for yourselves.