Just wanted to a share a dataview/templater combo I'm using to create notes from events. #120
The1029
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
This combo creates a table view of events in your daily note with clickable links to create notes on demand. I use this when attending conferences/meetings to take notes in Obsidian.
If you already have notes in the "description" field in your calendar, these will be pulled into the body of the note at the time that it's created. The templater setup "fails gracefully", so if you create a fresh event in Obsidian without pulling from a calendar, it will give you blank fields instead of errors.
Be Aware: This simply creates a note and pulls in the data once, it is not a two-way sync. Updates to event times/descriptions made in Obsidian will not be reflected in your calendar, and vice-versa. If you make changes in your calendar and want them reflected in Obsidian, you will either have to do this manually, or delete the note and create it again.
Obligatory disclaimer: it works on my machine! I hope you don't run into issues, but if it doesn't work please ensure you have everything setup as described below. This assumes you have some knowledge of JavaScript, as well as Templater and Dataview. If you don't, you should! Please check their docs and YouTube for tutorials. I accept no responsibility for any loss of data/problems you run into - test in a fresh vault first if you're unsure.
Setup
You will need to create an
Events
folder if you don't already have one. You'll also need to create a template calledevent.md
. If you'd rather use different names/locations, just edit the code below to point to your destinations of choice.In Templater, you'll need to enable Folder templates, and set one up so that any new notes created in your
Events
folder use theevent.md
template.In the ICS settings, set your time format to
YYYY-MM-DDTHH:mm
like this:This is the default format expected by moment.js.
You will also need to have javascript queries enabled in Dataview, if you don't already.
Notes Content
Place this where you want it in your daily note. If your daily template is not called
daily
, change the value in the firstif
statement. See moment.js docs for more info on how to modify date formats.And place this in your
event.md
template. I usetype: event
in my metadata, but if you prefer tags you can modify appropriately.And you're all set! When you create the note, it will take a few seconds to pull from your remote calendar (as it does to load events in the first place), but be patient and they should appear. If you only get blank metadata fields with calendar set to
obsidian
, templater has not found the event - check you have everything setup correctly.Beta Was this translation helpful? Give feedback.
All reactions