Notion scripts for setting up a database calendar for my courses.
index.js: creates pages from a json-like objectcopy.js: duplicates pages from one database to anotherDATABASE_IDsource databaseDATABASE_ID_COPYdestination database- filters for page.date > now
.env file (see .env.example):
NOTION_TOKENnotion api token (docs)DATABASE_IDthe id of the database being worked with- go to a database, copy link;
https://www.notion.so/<username>/<database_id>?v=<view_id..?>
- go to a database, copy link;
DATABASE_ID_COPY
Create an "internal" Notion integration. steps
Add the api token to your .env file.
Then, for each database that the script will run for, enable the automation workflow's access to the it via the "Connections" / "Connect to" menu option. steps
Script usage: node index.js, node copy.js.