I’ve reviewed this thread ( New Properties and templater prompts and commands?) but am unable to get the suggestions to work.
What I’m trying to do
I’ve been using these three properties in my YAML frontmatter for a few years and with the Obsidian properties update they ‘broke’.
Here are the existing YAML/Frontmatter properties:
UID: <% Math.round(((Math.random()1015)(tp.date.now(“YYYYMMwwDDHHmmss”))/(Math.random()*1015))) %>
File Creation Date: <% tp.file.creation_date() %>
modification date: <% tp.file.last_modified_date(“dddd Do MMMM YYYY HH:mm:ss”) %>
I’ve spend the last two weeks reviewing the above mentioned thread and am unable to get any of the coding suggestions to work. I’m not a programmer so I’m not quite catching what all is happening in the suggested code examples.
For notes already created, the properties aren’t throwing an error for the UID and File Creation Date properties have a number already listed that was generated by Templater when the notes were created. The Modification date is throwing an error in the Properties editor and is used to drive some Dataview tables in my vaults (I can live without it).
I tried to move the UID, File Creation Date, and modification date properties into the body of the note itself but the UID and modification date properties are still throwing an error when in the Body of the note.
I’d like to keep the UID and File Creation Date in the YAML Frontmatter if possible. The last modification date can live in the body. I can still access if for Dataview to work…
Things I have tried
I attempted to put the three properties into the body of the Template, as a test. File Creation Date is the only one that won’t throw a console error and abort creating a new note.
I believe the main error showing in the console is: “Uncaught (in promise) TypeError: Cannot read properties of null (reading ‘parent’)”
I need some help 'migrating these to the update version of Obsidian and will greatly appreciate any help.