Optimizing Employee Notes in Obsidian with DataView (or others)

Hello Obsidian community,

I’ve been using Obsidian for several years now, both for personal and professional purposes. As a team lead, I also use it to keep notes about my colleagues, which helps me with things like yearly reviews and overall team management.

I’m an avid user of Daily Notes, and often make quick notes about team members by tagging them with [[Name]]. However, I’ve found it quite cumbersome to manually collect and consolidate all the information into something useful.

What I’m trying to do

My idea is to optimize this process so I can have something like an employee file, where all notes related to a specific colleague are displayed using DataView. I want to be able to add a short note for each employee, allowing me to see a key fact without having to open their file. If I need more information, I would like to simply click a link to jump to the respective note for deeper insights. My current solution is a bit clunky and feels inefficient, plus it struggles with multiple mentions of a colleague in the same note.

Things I have tried

Here’s an example that works:

# 1 Notes
- (Teammember::[[Peter1]]) (TeammemberNote::created something great. 👍)

And here’s an example that doesn’t work (in the reading view of Obsidian, only the first list entry is shown twice, which makes me suspect this approach isn’t correct):

# 1 Notes
- (Teammember::[[Peter1]]) (TeammemberNote::did something bad. 👎)
- (Teammember::[[Peter1]]) (TeammemberNote::did another bad thing. 👎)

My current DataView attempt looks like this:

TABLE Teammember, TeammemberNote FROM "" WHERE Teammember = [[Peter1]]

It doesn’t properly handle multiple mentions in the same note, and I’m hoping for a more efficient solution.

Has anyone here tackled a similar problem or have any suggestions for improving this setup?

Thanks in advance for your help!

You could try to use contains() instead of = :blush: :

```dataview
TABLE Teammember, TeammemberNote 
FROM "" 
WHERE contains(Teammember, [[Peter1]])
```

It might still not give you the exact result you’d want though :innocent:

Hello,

Thank you for the quick reply. This works better than my solution. Unfortunately, it also shows notes about other colleagues that are mentioned in the same file

# 1 📝 Notes
- (Teammember::[[Peter1]]) (TeammemberNote::Multi-Member-View-1)
- (Teammember::[[Peter2]]) (TeammemberNote::Multi-Member-View-2)

So I have now only been able to find a solution using JS. On the PC, the performance looks OK for now. A quick test on the mobile phone also looked pretty good. So it’s OK for me for now.

Maybe it will be interesting for one or the other.

Solution

P.S. I have now omitted these inline fields etc. pp. I also differentiate between mentions with :-1: & :+1: as ratings and other mentions

(async () => {
    let memberName = dv.current().file.name;
    let memberPath = dv.current().file.path;

    // Get all files that link to the current file
    let sourceFiles = dv.pages().where(p => p.file.outlinks.some(link => link.path === memberPath));

    let notes = [];

    for (let file of sourceFiles) {
        let content = await dv.io.load(file.file.path);
        let lines = content.replace(/\r\n/g, '\n').split('\n');
        let regex = new RegExp(`.*\\[\\[${memberName}(\\|[^\\]]+)?\\]\\].*`, 'i');

        for (let line of lines) {
            if (line.match(regex)) {
                if (line.includes('👍') || line.includes('👎')) {
                    let noteText = line.trim();
                    notes.push({ file: file.file.link, note: noteText });
                }
            }
        }
    }

    dv.table(["File", "Note"], notes.map(n => [n.file, n.note]));
})();

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