A comment about a note is automatically placed in this note

Things I have tried

The Obsidian concept is a wonderful opportunity to see your thought process, improve it, and also take interesting decisions from other users. Working with my information from different areas of life makes me constantly reconsider the structure of the repository, the relationship of notes, the patterns for creating them.

I currently use Daily Notes as my main notes. When a task appears, in the daily note I create a project - [[project]]. A separate note “project” contains information about the project, tasks, comments (additions) and more. In this regard, I would like to be able to add a comment mentioning “project” in the form [[project]] when writing the daily note. And this mention (not just the link) would appear in “project” in its entirety as a block in a certain place. Today I’m using the wonderful “Influx” plugin. But, in my opinion, it has two drawbacks: it does not work in reading mode and is placed only at the end of the note.

What I’m trying to do

I tried using dataview:
  • in the daily note ‘[[project]]:: bla, bla, bla…’
  • in the note “project”
table this.file.link as "comment"
from ""
where this.file.link and contains(file.outlinks, this.file.link)

and I get in the table a link to a daily note and a link to “project” :frowning:
Please advise what could be the solution.

Two previous point:

  • you can’t use links as fields keys.
  • table this.file.link as "comment" - this.file.link as a column field is a static value, a link to the current file, not a field which key is equal to the link of the current file.

About your goal, they’re many ways. I can suggest three.


Files

Let’s consider this files:

ABC1

project:: this is a comment about [[projectABC]]

other content

project:: [[projectABC]] this is another comment

other content

- this is a comment related to [[projectABC]] and another [[ProjectB]]
- this comment is about my day
- [[projectABC]] focus

ABC2

project:: comment 2 about [[projectABC]]

other content

project:: another comment to [[projectABC]] file

project:: another projectABC to [[ABC3]]

ABC3

my daily note content...

## [[projectABC]]
- comment 1
- comment 2

## other section
blah, blah..

ABC4

## [[projectABC]]
- this is a comment about
- another one


## other section

blah, blah

- working in [[projectABC]] and planning [[ProjectB]]


Queries

Now the queries in file “[[projectABC]]” to explore three ways:

1 - first way is related with list items (bullet point lists) under a specific header (a link to the project note)

TABLE rows.Lists.text AS comments
FROM [[]]
WHERE file.lists
FLATTEN file.lists AS Lists
WHERE meta(Lists.section).subpath = this.file.name
GROUP BY file.link AS File

2 - second way is related with the use of the field project:: (a field type to any project) that contains a link to [[projectABC]]:

TABLE rows.proj AS comments
FROM [[]]
WHERE project
FLATTEN project AS proj
WHERE contains(proj, "[[" + this.file.name + "]]")
GROUP BY file.link AS File

3 - this way is related with “free” list items in any place that include a link to projectABC file:

TABLE rows.Lists.text AS comments
FROM [[]]
WHERE file.lists
FLATTEN file.lists AS Lists
WHERE contains(Lists.outlinks, this.file.link)
GROUP BY file.link AS File

Results

3 Likes

Your advice is always very informative and helpful. Thanks a lot! :slight_smile:

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