# Connecting Datacake to Notion Using Zapier

## 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](https://datacake.co/) to Notion via Zapier. This can be particularly useful for:

* Generating custom reports
* Establishing audit logs

<div><figure><img src="/files/DmYJJua2tb0cFO7x5WD0" alt=""><figcaption></figcaption></figure> <figure><img src="/files/bmAqjP3eZ92zLus9ZEzK" alt=""><figcaption></figcaption></figure> <figure><img src="/files/EyLu7dsY6rcKVW9dLY2T" alt=""><figcaption></figcaption></figure></div>

## Prerequisites

Before you begin, ensure you have the following:

* An active [Datacake](http://app.datacake.de/) account.
* An active [Notion](https://www.notion.so/) account.
* A [Zapier](https://zapier.com/) 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.

<figure><img src="/files/bQ5vepxFI5loNopgoU3c" alt=""><figcaption></figcaption></figure>

### 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.

<figure><img src="/files/sKFloNHFA413LnQgO2FC" alt=""><figcaption></figcaption></figure>

### 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.

### 5. Link Datacake to Zapier

* **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.

<figure><img src="/files/EyLu7dsY6rcKVW9dLY2T" alt=""><figcaption></figcaption></figure>

### 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.

<figure><img src="/files/qOKvEuHH9KzXQHHUkvf8" alt=""><figcaption></figcaption></figure>

### 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.

<figure><img src="/files/U26Q8VoI4uwPG1DLpjbB" alt=""><figcaption></figcaption></figure>

## Final Result

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

<figure><img src="/files/DmYJJua2tb0cFO7x5WD0" alt=""><figcaption></figcaption></figure>

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!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.datacake.de/guides/connecting-datacake-to-notion-using-zapier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
