Can we combine and / or overwrite implicit fields?

Things I have tried

For a sample file like this

---
file.tags: ['a', 'b']
---
#c
list file.tags from [[filename]]

Wanting something like this as output.

- a
- b
- c

Instead, the query returns

Dataview: Query returned 0 results.

What I’m trying to do

I want to have both types of tags combined into a single variable when queried from another page (like Map of Content).
In the example, by default, #c is the implicit field file.tags, However I am trying to append #aand #b through frontmatter.

  1. Implicit field: file.tags, not file.tag
  2. I doubt if you can use a field name with .; try rename it to file-tags
  3. Tags created in yaml frontmatter aren’t true tags.
  4. If you want to join the two (tags + pseudo-tags) you can join file.tags with file-tags. But to render the pseudo-tags with usual tags visual you need to write them as a string with # symbol: file-tags: ["#a", "#b"]
  5. Now, you can try this:
```dataview
LIST file.tags + ", " + file-tags
FROM [[filename]]
1 Like

Thanks. That answers it.

I tried this with tables too. But, this doesn’t work.

TABLE file.tags + ", " + file-tags
FROM [[filename]]

For Tables you need to add parenthesis and a title for the column (e.g. tags):

TABLE (file.tags + ", " + file-tags) as tags
FROM [[filename]]
1 Like

Tried this


tags: [ a, b, ‘c’, ‘d’]

#e #f

and with dataview

table file.tags from [[+]]

It seems to be working now.

1 Like

You are right: if you use “tags” in yaml frontmatter they become ‘true’ tags (showing in tag panel)…

EDIT
If you want to run a query inside the note to list all the used tags in these note, then you just need to write an inline query like this:

`=this.file.tags`
2 Likes

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