Datview Inline Links - Won't Show Just Links

I have a daily log where I jot down notes in various logs, such as gaming, using inline tags. For example:

GamingLog:: [[SomeGame]] - Did cool stuff

Sometimes though, I don’t jot down notes, just an internal link to whatever game I played

GamingLog:: [[AnotherGame]]

I’m trying to tweak a dataview I found to reflect both in-line entries based on the file date and the contents of whatever notes I jotted down.

Dataview I’m using is as follows:

table without id
      file.link as "Date",
      GamingLog as "Log"
from "Journal"
where contains(GamingLog, "")
sort file.name desc

The resulting table works great for any entries that have something beyond just a link for my note. In the above example, I would get the following result:

Date Log
2023-01-01 [[SomeGame]] - Did Cool Stuff

I’m missing the entry that only has a link and no additional text. What I’m hoping to get out of the dataview would be this:

Date Log
2023-01-02 [[AnotherGame]]
2023-01-01 [[SomeGame]] - Did Cool Stuff

Possible to have dataview provide a table entry where the only information after an in-line tag is just a link? Was also considering replacing the in-link tag with an actual #tag/gaming, but on days where I have multiple log entries, the above dataview code drops everything nice and neat with bullet points as a result. Thanks!

Hi @thyril , welcome to the Obsidian community!

I think the issue is in your WHERE clause. It looks like your intent is to filter down to just pages that have one or more GamingLog entries. In that case, I think you should change your WHERE clause to:

where GamingLog

This will filter down to pages where GamingLog has any value at all, whether it’s a link, a string, an array, or anything else.

The reason why your WHERE clause doesn’t quite work right is a little complicated. Briefly, using contains() only works if the value’s type is an array or a string – which it is when it was, for example, “[[SomeGame]] - Did cool stuff”. But when the value was just a link, it failed because links don’t work with contains(). You would have seen similar results, I think, if you had two GamingLogs in the same page.

I hope this helps.


And that works perfectly. And the dataview doesn’t pull any blank lines as was the other issue I was having with complicating matters. TY so much Craig!

1 Like

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