(See section “References” for templates & demo vault).
When I came across a feature request on these forums a few weeks back, for a challenge I have resolved for myself in the past, I felt the time for me has come to contribute something back to this fantastic community.
So I am sharing installation instructions and a vault demonstrating one of my workflows with you.
When the creation of a new note is triggered in my vault, this workflow presents me with dialogs to chose a template to apply, as well as for the selection of a folder location for the note. It works for both notes created through a dead Obsidian link, as well as those triggered through the “Create new note” command.
The workflow is one of the key enablers to my PPKM (Personal Productivity and Knowledge Management) practice.
Whilst I decided to undertake the effort to create this post in response to Choose a folder whenever a new note is created from a link, I now believe the “Share & Showcase” section is a more suitable home for it. I hope this is ok.
Disclaimer
This solution utilises Javascript, yet I am not a Javascript developer.
My code does what I want it to do, but you should be aware that the template I am sharing with you is far from perfect. Any improvements are welcome.Use at your own risk!
Installation
These are quick-start instructions to get you up and running with my note creation workflow and a first basic ‘New Note’ template in the vault of your choice. To avail of all workflow capabilities you will need to create additional templates and modify the script to meet your needs - or take a copy of my demo vault. You’ll find the downloads in section “References” at the end of this post.
Quick-start instructions:
-
Make a backup of your vault - or create a new one for try-out.
-
Did you create a backup of your vault?
-
Install & enable the Templater plugin (available in Obsidian’s ‘Community plugins’ section)
-
Drop the
New Note.md
&Note Creation Dialog.md
templates provided into your designated template folder. In my vault the location iszzSystem/Templates/Templater
, yet the location is up to you for as long as you amend paths in the next steps accordingly. -
Should you not have a default folder to create new notes in - create one. I call mine
_seedbox
(as assumed throughout this post). yet any valid folder name of choice will do. -
In Obsidian settings: Configure a “home” for new notes: In
settings > Files and links > Default location
and selectIn the folder specified below
. Add the name of your folder for the optionFolder to create new notes in
!
-
In the Templater settings, set the
Template folder location
to the folder from step 4. -
Still in the Templater settings, configure default template execution against the „home“ folder you have configured in points 5./6 for new notes:
- activate the option
Trigger Templater on new file creation
. This will enable a new section in settings calledFolder Templates
- In section
Folder Templates
, ensure the optionEnable Folder Templates
is active - Still in section
Folder Templates
, fill in theFolder
(your “home” for new notes) andTemplate
(theNote Creation Dialog
template). Your Templater configuration should now look similar to this screenshot
- activate the option
-
If you followed the instructions (and I provided them correctly - I did test them, I swear;-), you should now see the workflow kicking in when you create a new note from a link, or via the
Create New Note (CTRL-N)
command. If not, your next test should be to disable all plugins but Templater and restart Obsidian. Be aware, that all template options apart from the ‘note’ template are defunct until you a) create additional templates and b) either adapt the script to your needs or extend your vault structure to be compliant with the folder structure expected by the script:
Vault structure
As mentioned in an earlier post, I consider my setup highly opinionated. My vault structure is one of the enablers to my practice. It incorporates a mix of some aspects from PIM, CRM, GTD, Zettelkasten and provides the static, vertical capabilities of PPKM:
What the script does
My solution is enabled by SilentVoid13’s Templater plugin for Obsidian and is implemented via a central Templater template I call Note Creation Dialog
.
The central template contains Javascript utilising the tp
object provided by Templater to
- generate modals, asking the user to select a template, folder and optionally a name for the note in case note creation was not triggered via a click on a link
- move (and rename if needed) the newly created note to the folder selected by the user
- enrich the template selected by the user with links to “parent information” where applicable
- apply the selected template
Common functionality
- Provide the user with a modal dialog to select a template to be applied to the new note
- Provide the user with a modal dialog to select the folder to create the new note in. Limits options offered based on the template selected, where applicable (see below)
- If the new note was created from a link, use the name of the link as the note name, otherwise ask the user to provide a name for the note
- Add links to the
Venture/Workstream
orProduct/Component
at the top of the note where applicable (based on the folder path selected by the user) whilst updating the new note with the user-selected template
Functionality depending on selected template
Template | Folder Path | Comments |
---|---|---|
Meeting | ask user | 1. Prefixes the name of the note with the current date 2. Adds links to the “Venture/Workstream” or “Product/Component” from its folder path at the top of the note where applicable. |
Note | ask user | 1. Adds links to the “Venture/Workstream” or “Product/Component” from its folder path to the top of the note where applicable |
Contact | /Actors/ | * |
Organisation | /Actors/ | * |
Circle | /Actors/ | * |
Product | /Catalogue/ | |
Component | ask user | 1. User choice for folder selection is limited to folder paths containing Catalogue/ 2. Creates a new subfolder and folder note underneath the user-selected “Product” 3. Adds a link to the “Product” at the top of the note |
Venture | ask user | 1. User choice for folder selection is limited to folder paths ending in /Ventures/ 2. Creates a new folder and folder note from the user-provided name |
Workstream | ask user | 1. User choice for folder selection is limited to folder paths containing Ventures/ 2. Creates a new subfolder and folder note underneath the user-selected “Venture” from the user-provided name 3. Adds a link to the “Venture” at the top of the note |
*Contacts may be assigned to Circles and/or Organisations via note properties (not part of this workflow) |
Sample note “End user test session 1”, created against a Workstream called “Quality Assurance” from a Venture called “PPKM Solution”:
Credits
First, big shout-out to SilentVoid13 for his awesome work on the Obsidian Templater plugin. Like all open source work here, turning abstract ideas into reality, plus taking on the risk from exposing oneself’s ideas to the public, is super impressive. Hats off to that bravery and a huge thanks to all contributors in this community for their “sharing and caring”.
Second, to the creators of Obsidian. With their product and approach to the market, they created a dark horse that makes the world a little bit better for us and created the fertile grounds to enable this community.
Thank you.
Q & A
-
Q: Nice try, but a plugin to address the same issue already exists.
A: Should that be the case, please do let me know the name of the plugin - I am always happy to learn. -
Q: Since using your workflow I have a folder called “null” at the root of my vault
A: Mea Culpa - it’s a bug. Please report. Until two weeks ago, when I took the decision to publish my workflow, I simply hadn’t catered for the situation where a user wants to cancel out of the workflow. It was just faster for me to delete unwanted artefacts - but I don’t consider same good enough for publishing. So I updated my code after a year of use to cater for user cancellation, yet the related changes have merely seen manual testing and a week of use in production so far. -
Q: Since using your workflow I have “Untitled” notes in my seedbox/inbox
A: Same as the previous answer. -
Q: The note name has underscores - this is not what I entered
A: The file name of a note is the note name + the.md
extension, so there is a dependency between note name and file name. Your Operating System does not allow the use of certain characters in file names. Invalid characters include* " \ / < > : | ?
. When any of those characters are part of the note’s name to be created, my workflow would just bail and leave “null” folders and/or “Untitled” files behind (see previous questions) - good enough for me, but not good enough for a release. So I decided to replace any such characters in the note name provided with underscores, to neither break the workflow nor the “users flow”. I thought about presenting the user with another modal dialog to ask what they want to do, or gracefully cancel - yet, the purpose of my workflow is to reduce cognitive load, so in the end I decided to go down the character replacement route instead. -
Q: Why do you add links at the top of the note when the note is already in the correct folder?
A: There are several reasons, yet the most important one is to ensure compatibility with Obsidian’s concept of links: A link connects your notes, a folder structure does not. For illustration look at Obsidian’s Graph View and you’ll see what I mean. These concepts align beautifully with PPKM, where Folders satisfy the „necessary evil of logistics“ to enable verticals. In PPKM folders have no „intellectual value“, yet they free up tags and links to be used for the latter. -
Q: Why do you prefix the name of a meeting note with a date?
A: Think ceremonies (weekly-, daily meetings etc.) - you often have a single name for the series, yet you likely want all meetings of that series in the same folder. This will run you into a conflict: A note name must be unique within a folder. By default my workflow makes five attempts to append a note name with a number if the desired name already exists in the target folder, yet this is intended as a fallback only. IMHO, prefixing a meeting note name with a date-stamp is more elegant and intuitive than a number suffix, and comes with some additional benefits (e.g. when you want to sort them, or need to find one against the „time latch”). You will find that Obsidian gracefully takes care about updating the links to a note when the note name changes, which makes this approach possible. -
Q: It does not work
A: After following the installation section, only the prerequisites for the flow “note” are in place (and should work). I only provide you the template for a “note”, since it is the least opinionated and works with any folder structure. You will still be missing the templates (and possibly folder structure) for the other flows. You will need to create them yourself and also amend the script in the central template, should you chose a different folder structure (or use my demo vault to aid adoption). -
Q: This all sounds to alien to me. I just want your workflow to work in my vault.
A: If you believe the settings dialog of a plugin would help you bridge the gap, vote for the functionality to become a plugin. If you are not alone, we can create one together (between design, documentation, QA, logistics and maintenance there is more involved than just writing a script - and I am an amateur in half of these disciplines;-). If you end up being the only one, it will be more efficient for us to amend the script together. -
Q: I want feature X implemented in your workflow
A: Depending on the number of requests, this might be another reason to consider “plugin-ification”, simply because of logistics. So, let me know what you are looking for, but please understand that me suggesting same is not an indication of any ability to comply with your request. I will need to gauge what comes in, what is feasible. The only commitment I can give at this point in time is to stand up a project and repository, should community interest warrant the effort. -
Q: I want to know more about that practice you call PPKM
A: Same as for a plugin: Should there be a wider interest in the community to read about PPKM, I will try to start documenting what I call “a knowledge management practice for the rest of us” - as time permits.
References
- Templates “New Note” & “Note Creation Dialog” NewNoteTemplate_NoteCreationDialog.zip (5.2 KB)
- Demo Vault Demo Vault Workflow Syrupnas.zip (890.0 KB)