Tag bullets or lines in a note to summarize

Things I have tried

I have 100s of notes, one file for each client. As I take notes for the client in various meetings I want to tag certain notes with #env to indicate it’s related to their environment. For example a portion of the file could look like:

7/12/22: Meeting with John Smith
- We talked about XYZ
- John is on vacation next week
- They are using AWS as primary cloud #env
- More notes

7/10/22: Meeting with Jane Doe
- We talked about XYZ
- They primarily use Go for backend services #env
- More notes

I want to summarize all of my notes that are tagged with env at the top of the note.

The way I do it today is putting a tag for the client name at the top of the note (e.g., #clientA). Then i write a query like

```query
tag: #env tag: #clientA
```

This “works” but it’s far from elegant. For one, I don’t like have to do a client tag, but I only want #env tags from that note. The display isn’t great since it shows the whole note because of the client tag.

What I’m trying to do

I’d love a way to use dataview or query or any other method to have a simple list of any bullet/line that has the #env so it looks something like this

- first line with #env tag
- second line with #env tag
...

Hi @brian1917 - nice use of embedded query! I am not an expert on that syntax, but since you say you have one file per client, can you use the file:clientAFilename filter to narrow by client instead of a second tag?
If that does not do enough to solve the problem could the query filters line: or block: help?
Pinging @CawlinTeffid for more embedded search query expertise!

@scholarInTraining - thanks! Using file:clientAFilename is definitely an improvement over using the second tag.

Is there a way to use a variable. I think dataview has something like this.file.name to indicate the current file. Does query have anything like this?

This is a great question and I don’t know the answer! @CawlinTeffid ? @I-d-as ? Do either of you know how to limit an embedded query to the current file without having to manually type the file title each time?

Assuming the search query has already been drafted in the search pane and/or is easily copied to clipboard, I could envision a Templater script that could create or potentially update an embedded query, although the query may have to be relegated to exist within a specific heading in order to work. Apart from a workaround solution like that, I am unaware of any native functionality like this. I thought I had a slight memory of reading about something of the sort a while back, but upon some unsuccessful searching, etc., I am pretty confident I was mistaken.

Now I am interested if something turns up and will check back if I find or come up with anything helpful. Good luck!

1 Like

There’s nothing like that for searches, but since you’re embedding the search in the client’s note, you can set up a template for the searches and in the template put {{title}} where you want their name (Templates - Obsidian Help).

1 Like