Context
I have a nested database with some rows. I want to script creating a new row by coping an existing row OR by using a template.
Describe the bug
Unable to copy a page and have it save
To Reproduce
I first tried to do this outside of a database, just for a regular page but couldn't get it to work.
import { NotionCore } from "@nishans/core";
const nishan = new NotionCore.Api.Nishan({
token: "XXXXX",
logger: true,
});
(async () => {
const pageId = "some-UUID";
const pages = await nishan.getPagesById([pageId]);
const page = pages.page.get(pageId);
const res = await page?.duplicate(1);
console.log(res);
})();
It outputs some JSON, but I can't find the relevant page on notion or where its copied to. Any ideas on how to do this correctly?
2 additional questions:
- Is there a way to create a new row in a collection/database using a template? Or copy a row in a database into a new row?
- Is there a full working example I can use as a reference?
- Could you update the discord invite? The current link everywhere is invalid.
Context
I have a nested database with some rows. I want to script creating a new row by coping an existing row OR by using a template.
Describe the bug
Unable to copy a page and have it save
To Reproduce
I first tried to do this outside of a database, just for a regular page but couldn't get it to work.
It outputs some JSON, but I can't find the relevant page on notion or where its copied to. Any ideas on how to do this correctly?
2 additional questions: