Dataview: What's the difference between `key:: value` in a list and not in a list?

What’s the difference if I put my key in a list such as

- key:: value

vs. what I usually see people do

key:: value

Some of my values are too long and putting them in a list help me see better where the next key is. Or should I just use 2 line breaks as a visual indicator instead? Where can I read more about the difference?

1 Like

For most purposes, there’s no difference. Both forms will create a field at the page level that you can use with Dataview. I usually use the list form in my notes because they’re more readable for me.

There is a subtle difference between the two, but it only matters when you’re using Dataview to query the list items on the page. In that case the list form will show up but the page form will not (see example below).

Hope this helps!


Another thing related to the list variant, is that it can be used to group/separate fields within a page. Given the following page:

[NonItemField:: 1]  [some:: A]

- [ItemField:: 2]  [some:: B]

[some:: E]

[NonItemField:: 3]  [some:: C]

- [ItemField:: 4]  [some:: D]

Here it’s possible to split the list items using FLATTEN and keep the connection between the ItemField and their corresponding Some-field. Those on the page level are just collapsed together, and if there is a mismatch in occurences like with some:: E, you’ll never be able to re-connect it to the its corresponding NonItemField.

A better example could possibly be to use a list item (with or without subitems) to describe various metadata of that book. Within the list context it’s then easier to keep the data related to a given book, then within a page context.

In any case, this is slightly advanced (and somewhat mind boggling) to use properly, but I wanted to mention it, as you might run into related issues using either approach.


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