Add to existing note if exists, if not create new note

My apologies if this has already been addressed, I haven’t been able to find it anywhere

I am new to Obsidian, using it primarily for my PhD program. My system right now is to highlight, annotate, note, etc. academic papers in another tool, then import those into Obsidian. Once in Obsidian, I categorize and group the notes for easier reviewing such as tags and groups for definitions, theories, authors.

I’ve noticed that different authors and different schools of thought often define terms or theories differently and it is important for me to have one note for each term/theory with all definitions. I have a template set up that asks for the term/theory, definition, and other useful information and creates a new definition/theory note with that information but I am reliant on remembering or manually reviewing all definitions/theories to make sure it isn’t a duplicate definition/theory.

Is there a way to run a template/macro/something else where I can utilize the input from the term/theory dialogue box; queries my notes to look for the same term/theory; and, if there exists a note with that term/theory appends the rest of the content to that note or if no note exists for that term/theory creates a new note?

Or does anyone have suggestions for a better way to manage these multiple definitions?

1 Like

I’m wondering whether it might be helpful to alter your template so that the title includes the author or school of thought. If you were to be consistent with the naming such that the note is titled “term - author” then you could embed all of the notes defining the same term in a note named “term” to act as a compilation note. This way when you come across another definition of the term, You can simply use your template to create the “term - author” note then embed or link to it from the term note.

You could also look into the note composer plug-in or more complex Templater scripts. Check out this thread for some inspiration: Extract to specified heading with Note Composer While it might not be helpful for your specific use case, it might trigger an idea for you.

Good luck!