Need Help with Obsidian Dataview for Meeting Notes

Hello everyone,

I’m trying to set up a daily note system in Obsidian to track my meetings, and I’m hoping to get some help with using the Dataview plugin.

In my daily notes, I write entries like this:
“I had a meeting with [[xyz]] & we talked about this [[a link about the project]] #meeting.”

What I want to achieve is a Dataview table in the note for [[xyz]] that lists all the meetings I’ve had with them. Specifically, I would like this table to extract information from my daily notes based on two criteria:

  1. The presence of the “#meeting” tag.
  2. The mention of the link [[xyz]].

Essentially, whenever I write a meeting note involving [[xyz]], I want that meeting to automatically populate in the Dataview table within the [[xyz]] note, so I can easily reference all my past meetings with that person.

If anyone has experience with this or can provide me with the code or steps to set it up, I would greatly appreciate it!

```dataview
TABLE
FROM your-meeting-note-folder
WHERE #meeting
```

that’s the most straight-forward case that Dataview does. As for the link [[xyz]] you would need to include that in the YAML frontmatter, otherwise Dataview can’t find it.

So this depends on your specific daily note template, which would also influence your table fields. E.g. if your template looks like this

Date: 2024-10-28
Event: Meeting with [[xyz]]
Topic: Obsidian stuff

Then you could use this Dataview quey:

```dataview
TABLE
Date, Event, Topic
FROM your-meeting-note-folder
WHERE #meeting AND contains (Event, "[[xyz]]")
sort Date asc
```

If you want to share your template, we might be able to be more specific :slight_smile:

I’m currently taking meeting notes directly in my daily notes since they are usually quite brief. For example:

“I attended a meeting with [[Ashwin]]. #meeting

Is it possible for Dataview to pull the link [[Ashwin]] directly from the body of the note? I have many meetings and prefer to take notes on an individual basis, so tagging people in the YAML and then in the body would be very time-consuming.

Please correct me if I’m mistaken, as I’m still quite new to Obsidian. Also thank you so much for your input.

That’ll be slightly more complicated, because you’ll have to use DataviewJS, which you’ll have to enable in the plugin settings.

And then you can use this:

```dataviewjs
// Define the target link you're looking for
const targetLink = "[[xyz]]"; // The link you're tracking, e.g., [[xyz]]

// Define the folder to search in (replace "YourFolder" with the actual folder path)
const folderPath = "YourFolder";

// Get all files within the specified folder
const filesInFolder = dv.pages(`"${folderPath}"`);

// Initialize an array to hold results
let results = [];

// Iterate over each file in the specified folder
for (const file of filesInFolder) {
    // Load the file content
    let fileContent = await dv.io.load(file.file.path);
    
    // Remove all DataviewJS code blocks to avoid self-mentions
    const codeBlockRegex = /```dataviewjs[\s\S]*?```/g;
    fileContent = fileContent.replace(codeBlockRegex, "");

    // Split the file content into paragraphs
    const paragraphs = fileContent.split("\n\n");

    // Filter paragraphs that contain the target link
    const mentions = paragraphs.filter(p => p.includes(targetLink));

    // If mentions are found, add them to results with file name
    if (mentions.length > 0) {
        results.push({
            file: file.file.name,
            mentions: mentions.map(p => p.trim())
        });
    }
}

// Display the results in a table if mentions are found
if (results.length > 0) {
    dv.table(
        ["File", "Paragraphs containing xyz"],
        results.flatMap(result => result.mentions.map(p => [result.file, p]))
    );
} else {
    dv.paragraph("No mentions of xyz found in any file in the folder.");
}

```


1 Like

Mate it worked perfectly, you have no idea how easy you’ve made my work!
Can you also guide me with a roadmap or something for how you’ve learnt this type of coding for Obsidian & Javascript & Is it possible to contact you somewhere.
Thank You!

Just trying stuff, and then asking specific question on this forum mostly. If you have other questions you can just add a @ReaderGuy42 in the thread, and I’ll get notified, but there are plenty of people much more qualified to help :slight_smile: Good luck!

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