Getting calendar events into my Obsidian Daily note


Overview

In this tutorial, we will demonstrate how to integrate your Outlook calendar events into Obsidian daily notes using Make and the Templater plugin. This powerful combination allows you to automatically populate your daily notes with meeting details and provides an efficient way to manage your schedule and notes all in one place

Flow

How to recreate this automation

Resources

Step 1: Create a Make.com Scenario

Completed scenario will look like this

  1. Log in to your Make.com account and create a new scenario.
  2. Add a Webhook module with a Custom Webhook.
  3. Name the webhook and add any necessary security measures, then copy the unique URL provided. Create a webhook

Step 2: Set up the Outlook Calendar Connection

  1. In the Make.com scenario, add a Microsoft 365 Calendar module and choose the API call option.
  2. Configure the API call using the date parameter passed from the webhook, adjusting the time zone if necessary. The Outlook 365 Calendar node

Step 3: Transform the Data to JSON

  1. Add a JSON module to the scenario and choose the "Transform to JSON" option.
  2. Select the body returned from the previous step as the object to transform. JSON Transform node

Step 4: Create a Webhook Response

  1. Add a Webhook Response module to the scenario and set the status to 200.
  2. In the body, use the JSON string created in the previous step.
  3. Save the scenario and run it once to test the setup. Webhook response node

Step 5: Configure the Templater Plugin in Obsidian

  1. Install the Templater plugin in Obsidian and create a new template.
  2. In the template, write the code to call the Make.com webhook, ignore specified subjects, and output the events as Markdown text.
  3. Save the template in a designated folder in Obsidian. Here is the code we used for our Templater plugin.
1<%*
2async function getDataFromAPI() {
3
4const ignoredSubjects = ['SR', 'Standup/Knowledge Share', 'Review Day/Write up notes', 'Friday Afternoon Internal Meeting Free Zone'];
5var ret = ''
6
7try {
8  const dateToRequest = tp.file.title;
9  const response = await fetch('https://hook.eu1.make.com/12345678?date=' + dateToRequest);
10  
11  const data = await response.json();
12  
13	console.log('returned data')
14  data.map((item) => {
15    if (!ignoredSubjects.includes(item.subject)) {
16      const line = '### ' + item.subject;
17      console.log(line);
18      ret += line + '\n' + '\n';
19    }
20  });
21} catch (error) {
22  console.error(error);
23}
24
25return ret;
26
27}
28
29tR += await getDataFromAPI();
30%>

Step 6: Integrate the Templater Template into Daily Notes

  1. In your Obsidian daily note template, add the code tp.file.Include followed by the name of the Templater template created in Step 5.
  2. This will ensure that the calendar events are imported each time a new daily note is created.

With this setup, your Outlook calendar events will be dynamically imported into your Obsidian daily notes, allowing you to easily manage your schedule and meeting notes in one place. This method can also be adapted to integrate other APIs or personal data using Make.com or similar automation platforms.