Minimal Documentation "Create a movie database"

Things I have tried

I have followed the directions step by step. I have researched “Dataview” to ensure I am using it right. Researched the other plugin that is called in the directions. It is not working correctly.

What I’m trying to do

I copied the Template coding:

poster: {{VALUE:Poster}}
imdbId:{{VALUE:imdbID}}
scoreImdb:{{VALUE:imdbRating}}
length:{{VALUE:Runtime}}

category::{{VALUE:typeLink}}
director::{{VALUE:directorLink}}
genre:{{VALUE:genreLinks}}
year:{{VALUE:Year}}
cast:{{VALUE:actorLLinks}}
plot::{{VALUE:Plot}}
watchlist:: [[{{DATE:gggg-MM-DD}}]]
rating::

#movies #to-watch

Movie Gallery:

cssClasses: cards, cards-cover, cards-2-3, table-max

table without id
	("![](" + poster +")") as Poster,
	file.link as Title,
	string(year) as Year,
	"by " + director as Director,
	"⭐ " + scoreImdb as "⭐ IMDB",
	rating
from #movies
where poster != null

I have a folder named “movie”, in this folder there are five movies. They show all the information.

The Dataview shows the headers but not the movies. I may not be tagging it right. I am adding the #movie at the bottom of a movie but it shows nothing.

Any help would be greatly appreciated. Thank you.

The tag in your Dataview query should match the tag in your notes - “#movie” is not the same as “#movies”. It does not matter what word you pick for the tag but make sure it is the same in every note and in the dataview query for those notes!
Does this change your results?

Sorry, I put #movie, but my tag and the Dataview is showing the same thing. It did not change anything. Does it matter where I put the tag in my movie? I have it in “status”, also tried it at the bottom of everything. Still not working. Thank you for your reply.

If you use the built-in Obsidian search for “tag:#movie” (without the quotes) do your movie files appear? If so, the tag is not the issue.
Then you could try removing the last line of the Dataview where poster != null to see if that causes more things to show up. If nothing changes, put it back.

Does this mean you have a table that looks like

Poster (number) Title Year Director star IMDB rating
Nothing at all?
Is there a 2nd row?

If not, what does your table look like? And what is the number that shows up after “Poster”?

Well, with your help we have some success. Here is what it looks like right now.

Hopefully you can see it. First time on this forum. Thank you very much what you have done so far.

1 Like

Thanks, the image is helpful! Could you post one for one of the movie files that is filled in? Because for some reason dataview is not finding any of that filled-in information. If it cannot find information, then the value of the field is “null”, which is why removing the where line caused these things to appear.

Also, when you look at your template file, is there anything different about the “director::” line (where dataview is able to successfully find the value and put it on the table) and lines like “rating::” or “scoreImdb::” where the table lines were blank?

Here is a picture of one of the movies that I put a tag on.

As far as Director:: line and so forth. I just copied what was on the website. So not sure about that. Here is a picture of the template.

Thank you for all of your help, so far.

1 Like

Thanks for the images! Your template does look like it matches the one on the website, with the only differences I can see being that the website puts exactly one space between a field name like poster: or director:: and the value e.g.
scoreImdb: {{VALUE:imdbRating}}.

However, the “Top Gun” file does not seem to exactly match the template!
In the template, many of the fields like director:: have 2 colons after the name because they are inline dataview fields. If an inline field name does not have 2 colons, dataview cannot find it. Field names with 1 colon are used only in the YAML frontmatter, the very top part of the file that starts and ends with three -. In your template file, that area has a different background color. In the “Top Gun” file, I do not see any separate area at the top with a different background. Any dataview fields outside that top of the file frontmatter area must have 2 colons :: after their name for dataview to find them! It is your choice whether to put any field in frontmatter or inline, so you do not have to use the separation from the template but you do need the right number of colons depending on the location.

Can you double-check your spaces in the template (the spaces look ok in the “Top Gun” file) and double-check the number of colons in your movie files matches up with the dataview rules and then see if you get more information in your table? Sorry that this will be a little tedious, but once you get it working there should not be any more tediousness.

Good day;
I did as you suggested and was still getting the same results. So I went and copied the template info and pasted as plain text. I did the same with Dataview. Here is what I get now.

Again, thank you for the help you are providing. I am usually decent at figuring things out, but this one does not make sense. Thank you again.

1 Like

Pasting as plain text is a very good idea! To help you see extra “non-plain-text” things that might be confusing your output, you can temporarily change your editor to “Source Mode” by clicking the pencil icon on the bottom, near the right, just before the word count. When you change to “Source Mode” the pencil will be replaced with a different symbol; click that and then “Live Preview” to get back to your current view.

And now the correct rows of the dataview table are filled in for your template file, so that makes sense at least. Can you use the template to add another movie example and see if the formatting matches what you expect?

Ok, did what you said. So I learned something there, thank you. But it did not do anything. What I have been noticing is the line:

where poster != null

If I leave that in I get:

If I take it out I get this:

This is a “Top Gun” file that is fixed to have the right number of :: after the field names? Because what that is saying is that dataview is finding the tag correctly in the “Top Gun” file, but cannot find the values of any of the fields.

1 Like

:smile: :smile: Ok, it is WORKING!! Just two things though. It is listing the “Movie Template” as a list in “Movie Gallery”, and it is not showing the other fields such as;

Category, Genre, Length, Cast , Plot.

It shows all that if you hover over the Title link. Thank you very much. You have been a great help.

1 Like

Yes you will have to add a line to the dataview query to remove the template.
adding at the bottom
WHERE file.name != "Movie Template"
should do that.

To add other columns to the table, you would add on to the portion above the line from #movies. Every column except the last one needs a comma after its line. as "colName" lets you define the header for the column, and as you can see with the rating column, is optional. Good luck!

1 Like

Everything is working great. Thank you very much for your help. You were patient and professional. Take care.

1 Like

Yes you will have to add a line to the dataview query to remove the template. adding at the bottom WHERE file.name != “Movie Template” should do that.

To add other columns to the table, you would add on to the portion above the line from #movies.

Every column except the last one needs a comma after its line. as “colName” lets you define the header for the column, and as you can see with the rating column, is optional.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.