Is it possible to make a property list be dinamicly populated by a dataview functions?

What I’m trying to do

Make a property list based on a dataview query. I want to be able to write a note, and set a property on it. That’s the main idea, but I do not want to wirte the name of the property every single time since it is based on a file name. I want to make it as every time it finds a page with “account:nasa” && “type:opp” properties, it adds to the property list on the new note template.

The main goal is to print all notes on the opps.md. So all accounts on my vault have multiple opps, and those opps have different notes. So i want to print all notes that matches its opps and accounts in a ordered manner.

Can someone help me?

This is my current script for printing all notes, it’s not completed yet.

const folder = "Notes";

  

// Get all pages in the specified folder with the properties account: SETIC and tipo: note

const pages = dv.pages(`"${folder}"`)

.where(p => p.Account === "NASA" && p.Tipo === "Notes");

  

if (pages.length > 0) {

dv.header(3, `Files in "${folder}" with account: NASA and tipo: note`);

// Print the file names as plain text with ![[file]] links, separated by commas

dv.paragraph(pages.map(p => `![[${p.file.name}]]`).join(", "));

} else {

dv.paragraph(`No files found in "${folder}" with account: NASA and tipo: note.`);

}

I’m sorry but I couldn’t completely follow you - not your fault of course…

I’m just going to ask you: why not leave Dataview out and make Templater templates that pre-populate the properties based on what folder they are initiated from or what type of files they are going to be…?

a fellow scientist wrote some scripts that may be interesting for you:

I gave a quick read about it. It sounds nice, but the problem is that it heavily uses a folder system. I was planning on ditching the entire folder system and use only a default page for each account were I could grab any information needed.

I guess templater combined with dataview would help me, I’ll give the MTP a try anyways, seems interesting, thanks for the suggestion!

search also for obsidian api metadatacache
there are all kinds of scripts everywhere that could be helpful

no need to use folders - if i remember correctly, the person moves files into folders, so it’s not like normal Templater folder-based picking

also, there’s a guide by @Caffae AKA Pamela Wang - you can try BryanJenks’s/Her system:

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