Notion Database
Query a public Notion database, supporting both basic information and SQL query.
This widget supports multiple actions. For a more comprehensive understanding of its functionality, we recommend reviewing the following documentation carefully.
You need to pass both the action
and other input parameters of the chosen action to your module_config
Try it in the Widget Center
Click this url to try this widget and copy the Pro Config template.
Usage
Query the Whole Database
action
query_all
Input Parameters
Name | Type | Description | Default | Required |
---|---|---|---|---|
url |
| URL of the public database | ||
action |
| The action you want to perform | query_all |
Output Parameters
Name | Type | Description | File Type |
---|---|---|---|
data |
| The returned database in list |
Output Example
Obtain the Column Names
action
query_schema
Input Parameters
Name | Type | Description | Default | Required |
---|---|---|---|---|
url |
| URL of the public database | ||
action |
| The action you want to perform | query_schema |
Output Parameters
Name | Type | Description | File Type |
---|---|---|---|
data |
| The column names of the database |
Output Example
Query All Values of a Specific Column
action
query_column
Input Parameters
Name | Type | Description | Default | Required |
---|---|---|---|---|
url |
| URL of the public database | ||
action |
| The action you want to perform | query_column | |
column_name |
| Colume name to query |
Output Parameters
Name | Type | Description | File Type |
---|---|---|---|
data |
| The values under a specific column |
Output Example
Query The Database with SQL
action
query_sql
This action provides an advanced query with SQL. The table name is defined as DATA
Input Parameters
Name | Type | Description | Default | Required |
---|---|---|---|---|
url |
| URL of the public database | ||
action |
| The action you want to perform | query_sql | |
sql_str |
| SQL string to query, please use it like 'SELECT * FROM database' | SELECT * FROM DATA WHERE Age < 18 |
Output Parameters
Name | Type | Description | File Type |
---|---|---|---|
data |
| The query results of the public Notion database |
Output Example
Add Rows
action
add_rows
This action provides a interface to add rows to a public notion database
Input Parameters
Name | Type | Description | Default | Required |
---|---|---|---|---|
url |
| URL of the public database | ||
action |
| The action you want to perform | add_rows | |
rows_info |
| Rows information to add | [{}] |
Output Parameters
Name | Type | Description | File Type |
---|---|---|---|
data |
| The query results of the public Notion database |
Output Example
Detailed Guidelines
In notion, we can type /database
to create a database. Then click the open as full page
as below:
click the share button and copy the url to feed into your Notion Database widget:
If you want to add information to the notion, you can use theadd_rows
action. The json format should follow the format like
However, f you want to use it in pro config use values of variables, please note that the"
symbols should be escaped like
The sturcture of proconfig may looks like
Last updated