Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a database automatically #29

Open
marissamarym opened this issue Jul 21, 2021 · 28 comments
Open

Create a database automatically #29

marissamarym opened this issue Jul 21, 2021 · 28 comments
Labels
feature request If it's a feature request from a user onboarding If it has to do with educating users on using the product

Comments

@marissamarym
Copy link
Contributor

marissamarym commented Jul 21, 2021

Discuss in #issue-29--create-a-database-automatically

  • What is the current functionality?
    We ask the user to create a database

  • What problems are you facing with the current feature?
    It's an extra set-up step

  • What is your idea?
    Create a database automatically with the Notion API, now that it's available

screen_shot_2021-07-21_at_1.18.23_pm.png

@marissamarym marissamarym added feature request If it's a feature request from a user onboarding If it has to do with educating users on using the product labels Jul 21, 2021
@juliarosenson
Copy link
Contributor

The Notion API only lets you create a database as a child of a page whereas the example template Database is a child of the workspace. Do we want to use the API to create a page for users and then add a database to that page?

@juliarosenson
Copy link
Contributor

The Notion API only lets you create a database as a child of a page whereas the example template Database is a child of the workspace. Do we want to use the API to create a page for users and then add a database to that page?

See how the parent param has to be a page parent, not a workspace

@marissamarym
Copy link
Contributor Author

The Notion API only lets you create a database as a child of a page whereas the example template Database is a child of the workspace. Do we want to use the API to create a page for users and then add a database to that page?

oh I see, yeah I think creating a page first works well then

@juliarosenson
Copy link
Contributor

juliarosenson commented Oct 5, 2021

The github docs on manually triggering a workflow docs say "Write access is required to perform these steps"

@juliarosenson
Copy link
Contributor

Assuming we can't give all users write access to the repo, I'm going to work on just providing curl commands for creating the DB

@juliarosenson
Copy link
Contributor

The github docs on manually triggering a workflow docs say "Write access is required to perform these steps"

screen_shot_2021-10-05_at_10.54.38_am.png

@marissamarym
Copy link
Contributor Author

sounds good, and that's probably more an expected way of doing it since few people know about manually triggering actions, and the button can be hard to find

@juliarosenson
Copy link
Contributor

Ok so digging deeper into the Notion API...

@juliarosenson
Copy link
Contributor

In order to create a DB we need a parent page, but in order to create a page via API we need a parent page or parent DB. So we'd have to ask user to create a blank page and then we could use the API to create a DB, or create a blank DB and we could use the API to update it

@juliarosenson
Copy link
Contributor

At this point though it seems more efficient to keep what we already have, instructing users to duplicate this DB into their own workspace. It's only a couple clicks to duplicate

@juliarosenson
Copy link
Contributor

In order to create a DB we need a parent page, but in order to create a page via API we need a parent page or parent DB. So we'd have to ask user to create a blank page and then we could use the API to create a DB, or create a blank DB and we could use the API to update it

Create a Page API reference
Create a DB API reference

@marissamarym
Copy link
Contributor Author

hm with the new API updates, would we even have to specify the properties on the database ahead of time? would it be possible for us to create properties dynamically on a blank database?

@juliarosenson
Copy link
Contributor

Yeah we would be able to update a database using one of their endpoints

@juliarosenson
Copy link
Contributor

Notion has their own repo that syncs github issues to a Notion DB https://github.com/makenotion/notion-sdk-js/tree/main/examples/notion-github-sync

@juliarosenson
Copy link
Contributor

Their Readme instructs people to first duplicate a simple DB and then their code creates pages from github issues and updates the DB

@marissamarym
Copy link
Contributor Author

awesome, so maybe the task here to reduce the amount of onboarding steps is to make it so users can start with a blank database instead of duplicating a template. we could change this issue to reflect that, or close this and make a new issue

@marissamarym
Copy link
Contributor Author

Notion has their own repo that syncs github issues to a Notion DB https://github.com/makenotion/notion-sdk-js/tree/main/examples/notion-github-sync

this project is great, but I believe you have to run the command every time you want to sync. the github action lets users install once, and have issues sync on all new changes

@juliarosenson
Copy link
Contributor

Will the amount of onboarding steps here really be reduced though? We're -1 step to duplicate a template DB but + 1 step to create a blank one, +1 step to obtain the databse id, +1 step to make the database ID and notion access token available for use

@juliarosenson
Copy link
Contributor

Notion has their own repo that syncs github issues to a Notion DB https://github.com/makenotion/notion-sdk-js/tree/main/examples/notion-github-sync

Right I was just sharing it as an example for how organized their onboarding steps

@marissamarym
Copy link
Contributor Author

yeah good point, so maybe we're not down on steps, but I think it'll be a reduced complexity to remove the duplicating step. I actually think to duplicate a DB you have to first duplicate the page, and then copy and paste the DB over- you can't duplicate directly

screen_shot_2021-10-05_at_11.53.25_am.png

@juliarosenson
Copy link
Contributor

I was able to duplicate directly (2 clicks) into a test Notion Workspace I create
• press the duplicate button in the top right corner
• choose the workspace

screen_shot_2021-10-05_at_11.59.42_am.png

screen_shot_2021-10-05_at_11.59.54_am.png

@marissamarym
Copy link
Contributor Author

hm weird, I only see Share there, not Search or Duplicate

@juliarosenson
Copy link
Contributor

I think it might be cause you're already inside the Fabric Workspace?

@juliarosenson
Copy link
Contributor

If you click on the ... on the side bar next to a DB do you see an option to duplicate?

screen_shot_2021-10-05_at_12.09.49_pm.png

@marissamarym
Copy link
Contributor Author

yep, just duplicated. it won't let me copy the table to paste it somewhere, maybe because it has no entries yet

@maneeshapanja
Copy link

decision de-prioritizing in favor of #issue-25--make-it-easy-to-sync-all-past-issues-not-just-newly-created-or-edited-

@OJFord
Copy link

OJFord commented Sep 7, 2022

#25

@OJFord
Copy link

OJFord commented Sep 7, 2022

Will the amount of onboarding steps here really be reduced though? We're -1 step to duplicate a template DB but + 1 step to create a blank one, +1 step to obtain the databse id, +1 step to make the database ID and notion access token available for use

I can 'Add Page', '...', 'Copy link' in three (very close together) clicks - not sure what I'm missing, why does the database have to be created? If I provide a top-level page then the API allows creating a database in it?

For what it's worth, my 'duplicate the template' flow was:

  • follow link from readme
  • opens in browser not app (which was already open where I was using Notion)
  • figure out login (usually use the app)
  • I'm now logged in to one of my pages, not the linked one
  • duplicate tab to retain logged in state
  • back back back back quickly to stop being redirected while I try to get back to readme
  • follow link again
  • '...'
  • 'duplicate'

And to be honest I think even if it were more clicks, just creating a new page (or even providing an existing one you want the db added to!) is an easier, more obvious instruction than the current 'note the database must be created from the template above'.


Also, it's not really related I don't think, but the discussion seems lumped in here - I think needing write access to the repo (for workflow_dispatch) should be avoided. I'm more inclined to use Notion's manual sync example and then this action going forward than that. Though I suppose you can change the token to remove that scope after running it once initially.. still not ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request If it's a feature request from a user onboarding If it has to do with educating users on using the product
Projects
None yet
Development

No branches or pull requests

4 participants