Trying to retrieve Callout with DataView

Sure, just change the first regex to be a global regex ('g'), and then loop through the results.

Demo vault updated: https://drive.google.com/file/d/1HvWT_WlxVRVTlJw-T2CCnyPfJRNi_kQJ/view?usp=sharing

```dataviewjs
// You can update this to filter as you like - filtering for just your daily notes would be good
const pages = dv.pages('#daily')
  
// This regex will find the contents of a specifically formatted callout
const regex = /\n```ad-(\w+)\r?\ntitle:(.+?)\r?\n(\*.+?)```/
  
const rows = []
for (const page of pages) {
    const file = app.vault.getAbstractFileByPath(page.file.path)
    // Read the file contents
    const contents = await app.vault.read(file)
    // Extract the summary via regex
    for (const callout of contents.match(new RegExp(regex, 'sg')) || []) {
        const match = callout.match(new RegExp(regex, 's')) 
        rows.push([match[2], match[1], match[3], page.file.link])
    }
}
  
dv.table(['Title', 'Type', 'Bullets', 'Link'], rows)
```
7 Likes