Overview
Quickly upload a file to a Notion Database. Unsupported Notion datatypes for upload are: - Files - People - Rollup - Relation - Formula
When uploading a file to a database in Notion, you have two options from Workflows: to replace an existing database or to append to an existing database.
Replace
When the Replace insert method is selected, this will do one of two things: 1) create a new database or 2) overwrite an existing database. The inputs provided will determine the behaviour. For instance, if the Database ID is provided, the blueprint will attempt to overwrite that existing database. If the Database ID is not provided, the blueprint will attempt to create a new database, but in order to do so the Page ID of where the new database will live is required. Additionally, when creating a new database, you can optionally provide the Database Name, not providing the Database Name will result in the created database being named "Untitled."
Append
When the Append insert method is selected, the blueprint will attempt to add new rows to an existing database. In order to do so, the Database ID is required, failing to provide it will result in an error.
NOTE - existing schemas and datatypes are strictly enforced. If there is a mismatch in datatypes for data being loaded, it will fail.
Variables
|
Name |
Reference |
Type |
Required |
Default |
Options |
Description |
|---|---|---|---|---|---|---|
|
Access Token |
NOTION_ACCESS_TOKEN |
Password |
✅ |
- |
- |
The access token assigned to the integration created |
|
Database ID |
NOTION_DATABASE_ID |
Alphanumeric |
➖ |
- |
- |
The ID of the notion database found in the URL. Is necessary if `Append` is selected |
|
Page ID |
NOTION_PAGE_ID |
Alphanumeric |
➖ |
- |
- |
The parent page ID where the Database will reside. Is only necessary if `Replace` is selected and the database doesn't exist. |
|
Database Name |
NOTION_DATABASE_NAME |
Alphanumeric |
➖ |
- |
- |
The optional name of the database to be created. If `Replace` is selected and the database doesn't exist, this will provide a name for the one that is created |
|
Source File Name |
NOTION_FILE_NAME |
Alphanumeric |
➖ |
- |
- |
The name of the file to load to Notion |
|
Source Folder Name |
NOTION_FOLDER_NAME |
Alphanumeric |
➖ |
- |
- |
The optional name of the folder containing the file to load to Notion |
|
Insert Method |
NOTION_INSERT_METHOD |
Select |
➖ |
append |
Append: append
|
The option to overwrite an existing database, or append additional rows |
YAML
Below is the YAML template
source:
template: Notion - Upload File from Workflows to Notion Database
inputs:
NOTION_ACCESS_TOKEN:
NOTION_DATABASE_ID:
NOTION_PAGE_ID:
NOTION_DATABASE_NAME:
NOTION_FILE_NAME:
NOTION_FOLDER_NAME:
NOTION_INSERT_METHOD: append
type: TEMPLATE
guardrails:
retry_count: 1
retry_wait: 0h0m0s
runtime_cutoff: 1h0m0s
exclude_exit_code_ranges:
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 249