# Capture: Insert a Related Notes Base into an MOC Note

> Insert a live Base view of related notes into an active MOC note by capturing from a .base template into the current file

You end up with one QuickAdd command that inserts a live "related notes" Base
view into whichever map-of-content (MOC) note you have open. The table shows
every note that links to that MOC and updates itself as your vault changes.

## Prerequisites

- Obsidian's **Bases** core plugin enabled (it renders `.base` files).
- A markdown note to run the capture from, such as your MOC note.

## Why this pattern

Capture does not write directly to `.base` files, but it can still pull content
from a `.base` template and insert that content into the active markdown note.
This is useful for MOCs where you want a note-local index of backlinks.

## Setup

1. Create a `.base` template file, for example
   `Templates/MOC Related Notes.base`:

```yaml
filters:
  and:
    - 'file.ext == "md"'
    - "file.hasLink(this.file)"
    - "file.path != this.file.path"
views:
  - type: table
    name: Related notes
```

2. Create a Capture choice.
3. Enable **Capture to active file**.
4. Set **Write position** to **Top of file (after frontmatter)**.
5. In **Capture format**, reference your `.base` template with an explicit file
   extension:

Example:

````markdown
## Related Notes

```base
{{TEMPLATE:Templates/MOC Related Notes.base}}
```

Context: {{VALUE}}
````

6. Run the Capture choice while your MOC note is active
   (for example `MOCs/Alpha Project.md`).

QuickAdd reads the `.base` template and inserts its content into the active note.
Because the base view is embedded in that note, `this.file` points at the MOC,
so the table shows notes that link to that specific MOC.

![MOC related notes capture demo](../Images/capture_moc_related_notes_demo.png)