You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you edit the data structure of a block/collection, then you can sync it to notion using set, i.e. to add a new property:
cvb=client.get_block(collection_view_block_url)
# inserts a new property into the cached dictionarycvb.collection.get()['schema']['NewProp'] = {
"name": 'New property',
"type": 'text'
}
# loads the cached schema into a variable to make it easier to manipulateschema=cvb.collection.get()['schema']
# syncs the locally cached schema to the notion servercvb.collection.set(path=['schema'], value=schema)
N.B. if you add force_refresh=True in the get method before you set the dictionary, you will get the original i.e. the one stored in the actual notion database, not the cached one. Until you use set(), the structure/collection/block is not updated.
I don't know where else to ask, I was wondering how you can add a property to an existing collection?
The text was updated successfully, but these errors were encountered: