Insert the date field in YAML / Properties formatted as internal link (eg [[2024-09-24]])

What I’m trying to do

As part of user input through the Templater plugin, I’m asking for the meeting date to add to the meeting_date property of the note (amongst other input such as title, attendees, etc). I’d like this to be an internal link (which means the property itself is not a date type).

However trying to assign that string to a variable which ends up being the property value doesn’t work no matter what way I try to define it.

The note template currently looks like this:

<%*
let date_today = tp.date.now(“YYYY-MM-DD”)
let meeting_title = await tp.system.prompt(“Meeting title?”)
let file_name = date_today + " " + meeting_title
let date_of_meeting = date_today (to make the example simpler)
await tp.file.rename(file_name)
-%>

notetype: meeting
meeting_date: THIS IS THE PROBLEM FIELD

Things I have tried

I have tried a couple of things, both within the code, and in the yaml frontmatter section.

In the code:
let date_of_meeting = “[[” + date_today + “]]”
let date_of_meeting = ‘[[’ + date_today + ‘]]’

In the YAML section
meeting_date: [[<% date_of_meeting %>]]
meeting_date: <% date_of_meeting %>

These bring up either an error or an invalid locked property that you need to delete and re-instate manually after the note is created.

I guess this should be a two part question - is this even possible (it feels like it should be as it is possible to create that link manually in the property once the note has been created)? If so, what am I missing?

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