Tags auto-added to note

Is there a way to do this.

E.g. I have a note called Contacts
Everytime I add the tag Contacts to another note, that note is added to the Contacts note.

Hi @Xium,
what exactly you want to add to the Contacts note?
File link to the file that contains #Contact tag?
Or new Contact name? (how is formated your Contact? you store information as parameters in YAML? or as text in body of that note?

That was just an example, I’m new so there might be another way other than tags.

I want to be able to give notes a specific “property/name/label”, and if there is a note with the exact same name, then the note is automatically added to that note.

So empty Contacts note, John Smith is given the Contacts parameter, then Contacts now has the John Smith note within, again with Jane Doe, now the Contacts note has both John Smith and Jane Doe notes within

Just tag every new note with contact information with #contact.

You may like plugins like Automoc or Auto note mover

Then how do I get everything tagged contact in the contact note?

So imagine there was an intoductory statement and other data within; how do I add these other notes into the Scientific Methods note automatically?
I just want to be able to give a note a property of some description.
If there exists a note with the same name as that property, it is added to that note. E.g. In Utero has the “Scientific Methods” property. Now the “Scientific Methods” note has the In Utero note inside it.

Well you need to tag notes by yourself, if you don’t want this, assign a common prefix to your contact notes

Even without plugins you could load all your contacts in a note, example


This query finds all your notes containing “contacts”

Omg kunt

I don’t care about having to tag them, that’s 2s

I want them to be added to another note automatically after they have been tagged; rather than me making 50 notes then manually adding them to other notes.

I just explained how to add new contracts to a common (moc) note. See the example query syntax.

I got a bit frustrated there, sorry.

It’s better than what I have now; but is there another way?
Is there a way to just have them displayed as if I manually added them?

Use the dataview plugin

So far I have only been able to display them as links…

install community plugin templater, that allows you create template for any type of notes (not only Contacts :wink: )
after that, setup plugin base settings like folder, where you will store templates:

, and then set some folder templates as you can see on this screen

Now you have to create template file in your <Template directory> with information you need to fill up with creating new contacts, something like this:

insert this into template file:

	async function updateFrontmatter() {
        let fname = await tp.system.prompt("First name");
        let lname = await tp.system.prompt("Last name");
        let phone = await tp.system.prompt("Phone");
        let email = await tp.system.prompt("email");  
        await tp.file.rename(fname + " " + lname);
        let file = app.workspace.getActiveFile();
        app.fileManager.processFrontMatter(file, async (frontmatter) => {
			frontmatter["First_name"] = fname;
			frontmatter["Last_name"] = lname;
			frontmatter["phone"] = phone;
			frontmatter["email"] = email;
			await app.vault.modify(file, app.fileManager.stringifyFrontMatter(frontmatter) + app.fileManager.stringifyBody(frontmatter.body));

and voilá … after you create new note in Contacts folder, it automaticaly runs our Contact form - fill it and New note will be created in Contacts folder with Note name same as contact name.


I’ve forgot to answer “How to display all contacts in one place”
Its easy (with community plugin dataview, just make new Note and then add this query:

from "Contacts"

or display contacts like list:

from "Contacts"

The contacts was just an example

I’m trying to add bunch of text and media from one note to another, not just list a bunch of variables from a note.

Like all of this would be added to a note called Insult or Lesion
The lesion note itself would have some data in it already; then this note will be appended to that note.

Learn about embedding/transclusions. Install the Copy Block Link plugin.
There are other plugins that help, like Note Refactor.

You want to automate stuff without touching a button? Is that so?

I want to automate shit using simple code structures and basic types of variables.

1 Like