Skip to main content

Edit database properties

Edits properties of an existing database

Function EditDatabaseProperties(Val Token, Val Base, Val Properties = "", Val Title = "", Val Description = "") Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Base--baseStringTarget database ID
Properties--propsMap of KeyAndValueNew or modified database properties
Title--titleStringNew database title
Description--descriptionStringNew database description

Returns: Map Of KeyAndValue - serialized JSON response from Notion


1C:Enterprise/OneScript code example
    Token = "secret_9RsfMrRMqZwqp0Zl0B...";
Base = "14682aa7-fc4e-8194-9797-d8cd67ca183a";

Title = "TestTitle";
Description = "TestDescription";

Properties = New Map;
Properties.Insert("Email", "rich_text"); // Type fields "Email" will changed with email to text
Properties.Insert("Website"); // Field "Website" will deleted

Result = OPI_Notion.EditDatabaseProperties(Token, Base, Properties, Title, Description);
    # JSON data can also be passed as a path to a .json file

oint notion EditDatabaseProperties \
--token "***" \
--base "14682aa7-fc4e-8101-86b1-d95806168981" \
--props "{'Email':'rich_text','Website':null}" \
--title "TestTitle" \
--description "TestDescription"
Result
{
"object": "database",
"id": "11a82aa7-fc4e-8138-a724-ee8786147d82",
"cover": null,
"icon": null,
"created_time": "2024-10-09T06:14:00Z",
"created_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_time": "2024-10-09T06:14:00Z",
"title": [
{
"type": "text",
"text": {
"content": "TestTitle",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "TestTitle",
"href": null
}
],
"description": [
{
"type": "text",
"text": {
"content": "TestDescription",
"link": null
},
"annotations": {
"bold": false,
"italic": false,
"strikethrough": false,
"underline": false,
"code": false,
"color": "default"
},
"plain_text": "TestDescription",
"href": null
}
],
"is_inline": false,
"properties": {
"Description": {
"id": "%3COFd",
"name": "Description",
"type": "rich_text",
"rich_text": {}
},
"Phone": {
"id": "Ne%7DI",
"name": "Phone",
"type": "phone_number",
"phone_number": {}
},
"CreationDate": {
"id": "P%3Doo",
"name": "CreationDate",
"type": "date",
"date": {}
},
"Active": {
"id": "Ub%7C%5D",
"name": "Active",
"type": "checkbox",
"checkbox": {}
},
"Number": {
"id": "%5Dotl",
"name": "Number",
"type": "number",
"number": {
"format": "number"
}
},
"Email": {
"id": "%60%7DN%3F",
"name": "Email",
"type": "rich_text",
"rich_text": {}
},
"Status": {
"id": "bAZ%7D",
"name": "Status",
"type": "select",
"select": {
"options": [
{
"id": "0e626378-0386-4985-88de-b747968504e7",
"name": "New",
"color": "green",
"description": null
},
{
"id": "e9a7ad5c-196f-4b2a-b2de-e84e849f2183",
"name": "InProgress",
"color": "yellow",
"description": null
},
{
"id": "1b214a08-6768-4381-b3cb-d8dd88250f8c",
"name": "Remote",
"color": "red",
"description": null
}
]
}
},
"User": {
"id": "%7B%3Bsu",
"name": "User",
"type": "people",
"people": {}
},
"Image": {
"id": "%7B%3F%5B%3F",
"name": "Image",
"type": "files",
"files": {}
},
"Name": {
"id": "title",
"name": "Name",
"type": "title",
"title": {}
}
},
"parent": {
"type": "page_id",
"page_id": "5dd94c34-fab0-4bff-986b-7511c0779f77"
},
"url": "https://www.notion.so/11a82aa7fc4e8138a724ee8786147d82",
"public_url": null,
"archived": false,
"in_trash": false,
"request_id": "2db0d0b9-71b2-45a9-87bc-e25489f09cf3"
}