Connecting Datacake to Notion Using Zapier

Learn how to write IoT sensor data to a Notion table using Datacake Rule Engine and Zapier Webhook automation.

About

Integration between tools can streamline your workflow and enhance the functionality of each platform. In this guide, we will walk through the process of connecting Datacake to Notion via Zapier. This can be particularly useful for:

  • Generating custom reports

  • Establishing audit logs

Prerequisites

Before you begin, ensure you have the following:

  • An active Datacake account.

  • An active Notion account.

  • A Zapier account (or create a new one if you haven’t used Zapier before).

Step-by-Step Guide

1. Setting up a New Rule on Datacake

  • Start on Datacake: Navigate to the rule engine section and click on the option to create a new rule.

2. Define Triggers

You can determine when this rule will be executed based on certain conditions or at specified time intervals:

  • For Time-Based Triggers: This is ideal if you're looking to generate periodic reports in Notion. Simply define the specific time intervals when you want the rule to run.

  • For Conditional Triggers: Set specific conditions in your data that will trigger the rule. This can be useful if you want to use Notion as an Audit Log platform.

3. Set Webhook as the Action

  • In the Action section of your rule settings, select "Webhook".

  • Datacake will ask you for a Webhook URL which you need to create on Zapier. We will show you how to do this in the next step.

4. Create a Zap in Zapier

  • Log into Zapier: If you’re not already a member, create a new Zapier account.

  • Set Webhook as Trigger: Once logged in, create a new Zap and choose "Webhook" as the trigger.

  • Copy Zapier's Webhook URL: Zapier will generate a unique Webhook URL. Copy this URL.

  • Paste into Datacake: Go back to the Webhook Action in your Datacake rule settings and paste the URL provided by Zapier.

6. Configure the JSON Payload on Datacake

Define the structure of the data you wish to send from Datacake:

  • Customize and set up the JSON payload in Datacake so it matches the data format you want to push to Notion.

Code Example

The following code shows a basic structure idea for the JSON you send over your Webhook.

{
    "ruleId": "{{ rule["id"] }}",
    "deviceId": "{{ triggering_device["id"] }}",
    "name": "{{ triggering_device["name"] }}",
    "temperature": "{{ triggering_device["measurements"]["TEMPERATURE"] | round(2) }}",
    "humidity": "{{ triggering_device["measurements"]["HUMIDITY"] | round(2) }}",
    "pm10": "{{ triggering_device["measurements"]["PM10"] | round(2) }}"
}

7. Test the Webhook

  • On Zapier: Click on "Start Test", ensuring Zapier is ready to receive the data.

  • On Datacake: Send a test data using the webhook.

  • On Zapier: Click on "Find new records" to see incoming webhook data.

Once successful, Zapier will acknowledge the received data.

8. Connect Notion to Zapier

  • In the subsequent step on Zapier, connect your Notion account. Follow the authentication process to grant Zapier permission to access your Notion data.

9. Prepare Notion Database

  • In Notion: Ensure the page and database you want to send the data to is set up. Also, make sure you pre-create the required columns for data reception.

10. Map Datacake JSON to Notion Columns

  • Back in Zapier: For each piece of data in your JSON payload from Datacake, bind them to the corresponding columns you've set up in Notion.

Final Result

You've now successfully connected Datacake to Notion via Zapier.

This integration enables your data to flow seamlessly between platforms, allowing for enhanced reporting and logging capabilities. Make sure to monitor your first few data transfers to ensure everything is functioning as expected. Happy integrating!

Last updated