Dataview plugin snippet showcase

Nice solution, but are you sure it is correct? I tried it and it just gives number 1 to all the items on the table.

You can get the value using length(); I got the number of files tagged #Ticket like so:

TABLE length(rows) as ticketCount
FROM #Ticket 

It was a little tricky to figure out the summing, but I got that as well. Here’s what I use to see how many points I’ve accumulated in my #Tickets for the current Sprint, as well as how many more I need to hit my current goal of 10:

TABLE sum(rows.Points) as TotalEarnedPoints, 10-sum(rows.Points) as PointsToGo
FROM #Ticket and [[Sprint Ending 2021-04-08]]
WHERE Ended != null

Huh, I mean its still working for me. What theme are you using? Did you add it to the main.css, or as a snippet?

So it’s definitely targeting the right element if you see the numbers in the right place. But it seems its not incrementing the value properly. That’s what the counter-increment: section; is for.

1 Like

Nice! I was missing the fact that you have to give the length(rows) value an alias! as whatever.

I also like the summing method, good catch :slight_smile:

1 Like

I am using it as a snippet, I am using Minimal theme with some other snippets from here:

yeah , it is definitely doing something right. or maybe it is because one of the plugins , it is hard to tell

You can use this CSS snippet to add lines to the rows of table view:

.table-view-table tr {
    border-bottom: 1px solid;

For something like this:

As opposed to this:


I’m not sure, hey. I don’t know much about CSS or the interaction with other plugins… Could you see if it works in Safe-mode? You would have to manually re-enable all your plugins afterwards, though

1 Like

I’m loving this dataview plugin. Automated lists makes it that much closer for obsidian to use as my primary PKM.

I’m a massage therapist and I’m experimenting with Obsidian. I use special tests to narrow down potential causes for pain and dysfunction. At the top of each test, I can have some information about the test for the automated list.

type: test
location: [shoulder, cervical]
dysfunction: [spaceoccupy, compression]

Now in my automated list I’d have code - lets say it’s my shoulder list…

table dysfunction from ""
where type = "test" AND location = "shoulder" 

It doesn’t pick up on this test, I’m assuming, because the location is not just the shoulder.

I’ve seen a solution something like

table dysfunction from ""
where type = "test" AND location[0] = "shoulder" 

but this only works if shoulder is the first item. I’d need it to work regardless of which position shoulder is listed.

I’m not a programmer (I dabble in css and html, I repeat myself), so I’m sure I’m just missing something simple. Any help would be appreciated :smiley:


Random long shot but try the contains function. It’s in the data view docs under object functions.

Not sure if it would work in this case but it may since that is a list object.

The syntax would look something like this:

where type = "test" and contains(location, "shoulder")

But don’t quote me on that being exactly the correct syntax.


Is it possible to have Dataview display a different string if a calculated field satisfies some condition? For example, if my calculated “days-left” field is less than or equal to 1, I want to display a warning emoji. I’m not sure if control logic like that is possible.

Screen Shot 2021-03-30 at 7.52.52 PM

1 Like

Btw, how do you guys use emojis? Do you memorize alt-code for each one or what?

I personally use the Emoji Toolbar plugin :slight_smile: But on Windows you can also press Win + . to bring up an emoji keyboard

1 Like

Yup, this should work :slight_smile:

As per the docs, contains works on lists like this: contains(list(1, 2, 3), 3) = true

Really interesting use case! :grinning_face_with_smiling_eyes: I’m a yoga teacher, and have been very eager to make notes for each pose with various metadata objects attached to each. I’m sure dataview would interact with these notes very well!

1 Like

It’s easy to create Alfred snippets or Keyboard Maestro hotkeys to insert them. Windows and Linux should have similar apps for inserting text snippets.

1 Like

yeah there is AutoHotKey that i use, but it gets messing as the number of hot keys increases. Considering shear number of emojis It’s better to have a app for it, or a plugin for every app like this one in Obsidian

I am trying to build a list of author names (grouped by first letter of the surname) that links to the corresponding notes which have a file name in format “surname, name” and are tagged #author.

For a start I used this:

FROM "" AND #author
WHERE contains(, "A")
SORT ascending

Obviously, this also includes notes like “Smith, Adam” which should not end up under the letter “A”.
I have tried the regexmatch function but have not managed to get it to work at all. If possible I want to avoid YAML.

Any brilliant and helpful minds out there? Would be much appreciated!

Interesting idea! I think regex could work for this. Could you give a list of file names that you would want the regex to match? Basically some test cases

Here is the list of names I currently get.
The first 6 should be included, the others not.

  • Alexander, Samuel
  • Amery, Carl
  • Anderson, Kevin
  • Arthur, W. Brian
  • Ayres, Robert U.
  • Abelson, Abel
  • Hall, Charles A.S.
  • Howes, Anton
  • Klitgaard, Kent A.
  • Morton, A.L.
  • Smith, Adam
1 Like

Does anyone have a working example of the use of regexmatch in Dataview? I don’t seem to get it to work and have the impression that there is something major I am overlooking…