Dataview returning note name not intended content

Trying out the Dataview plugin. After reading the documentation and watching some content on youtube I am trying to set up a list view that returns any bullet points that contain a certain tag.

The code, which matches what I am seeing on some of the tutorial documents is
list from #tag_I_want

The issue I am having is that the query is returning the title of the note in which that tag appears and NOT the actual bullet point that I have used the tag in.

Can anyone point me at what I am doing wrong? In the documentation and on the youtube videos from the devs when they use this same query it is returning the content tied to the tag (ie- the bullet point that the tag proceeds) and not just the title of the note.

  1. In DQL dataview queries, FROM is the source. So, with your query, you want a list for files with the tag “#tag_I_want”. Nothing more.
    Queries - Dataview
  2. If you want some content you need to work with specific fields (implicit fields or fields you create in frontmatter or inline) > Data Annotation - Dataview
  3. What you mean with intended content? A list of elements after your tag? Can you post an example from your sources (videos or documentation)?

For example

In a note in a separate folder I have a bullet point like this

  • #rock Q4 rock blah blah blah something

Then in another note I have another bullet point with that same tag

  • #rock some context about this other rock

In a different note in a different folder I am trying to return a list of bullet points that contain that #rock tag. My query is as I posted before

list from #rock

What I am expecting to see returned from my query is

  • #rock Q4 rock blah blah blah something
  • #rock some context about this other rock

but instead what I am getting is

  • Title of note number one that contains the bullet with the #rock tag
  • Title of note number two that contains the bullet with the #rock tag

It’s the expected behavior.
Tags works at page level, as source (from) and as an implicit field (file.tags gives you the list of tags inside your notes). And no difference if you write the tag one or more times in your note.
For your description, you need another thing: you need to work with inline fields - something with the syntax key:: value.
Maybe you had see an example with #tag:: blah blah blah, which is different. But the key don’t need to be a tag.
Try this:

  1. In your notes write:

note 1

rock:: Q4 rock blah blah blah something

note 2

rock:: some context about this other rock
other content … and adding more one rock field:
rock:: a second value for rock in same note

  1. Now the query (in table and list format):
```dataview
TABLE rock
WHERE rock
```

```dataview
LIST rock
WHERE rock
```

// a list without notes titles //

```dataview
LIST WITHOUT ID rock
WHERE rock
```

1 Like

Ok that worked and it makes sense. I was thinking the key was the tag and the value would just be the text content following. I have tried what you suggested and it works so thank you!

I will need to change how I am using tags and incorporate your suggestion in order to query bullet points.

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