1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-06-25 00:46:45 +02:00
Files
OpenIntegrations/docs/en/md/Notion/Database-management/Edit-database-properties.md

201 lines
4.3 KiB
Markdown
Raw Normal View History

---
sidebar_position: 3
---
# Edit database properties
Edits properties of an existing database
2024-07-10 13:58:29 +03:00
`Function EditDatabaseProperties(Val Token, Val Base, Val Properties = "", Val Title = "", Val Description = "") Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| Token | --token | String | Token |
| Base | --base | String | Target database ID |
| Properties | --props | Map of KeyAndValue | New or modified database properties |
| Title | --title | String | New database title |
| Description | --description | String | New database description |
2024-10-09 09:42:00 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Notion
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
2024-10-01 21:08:09 +03:00
Token = "secret_9RsfMrRMqZwqp0Zl0B...";
2024-10-13 15:00:04 +03:00
Base = "11e82aa7-fc4e-816a-9812-fcc332821c4a";
2024-10-01 21:08:09 +03:00
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);
```
```sh title="CLI command example"
oint notion EditDatabaseProperties --token "secret_9RsfMrRMqZwqp0Zl0B..." --base "5dd94c34fab04bff9..." --props %props% --title "Updated title" --description "Updated base description"
```
```json title="Result"
2024-10-02 10:03:52 +03:00
{
"object": "database",
2024-10-09 09:42:00 +03:00
"id": "11a82aa7-fc4e-8138-a724-ee8786147d82",
2024-10-02 10:03:52 +03:00
"cover": null,
"icon": null,
2024-10-09 09:42:00 +03:00
"created_time": "2024-10-09T06:14:00Z",
2024-10-02 10:03:52 +03:00
"created_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
"last_edited_by": {
"object": "user",
"id": "8b07422e-eeea-40d1-8d5e-c784211825b0"
},
2024-10-09 09:42:00 +03:00
"last_edited_time": "2024-10-09T06:14:00Z",
2024-10-02 10:03:52 +03:00
"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": {
2024-10-09 09:42:00 +03:00
"Description": {
"id": "%3COFd",
"name": "Description",
"type": "rich_text",
"rich_text": {}
},
2024-10-06 16:55:08 +03:00
"Phone": {
2024-10-09 09:42:00 +03:00
"id": "Ne%7DI",
2024-10-06 16:55:08 +03:00
"name": "Phone",
"type": "phone_number",
"phone_number": {}
},
2024-10-08 20:15:58 +03:00
"CreationDate": {
2024-10-09 09:42:00 +03:00
"id": "P%3Doo",
2024-10-08 20:15:58 +03:00
"name": "CreationDate",
"type": "date",
"date": {}
2024-10-06 16:55:08 +03:00
},
2024-10-09 09:42:00 +03:00
"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",
2024-10-06 16:55:08 +03:00
"type": "rich_text",
"rich_text": {}
},
2024-10-02 10:03:52 +03:00
"Status": {
2024-10-09 09:42:00 +03:00
"id": "bAZ%7D",
2024-10-02 10:03:52 +03:00
"name": "Status",
"type": "select",
"select": {
"options": [
{
2024-10-09 09:42:00 +03:00
"id": "0e626378-0386-4985-88de-b747968504e7",
2024-10-02 10:03:52 +03:00
"name": "New",
"color": "green",
"description": null
},
{
2024-10-09 09:42:00 +03:00
"id": "e9a7ad5c-196f-4b2a-b2de-e84e849f2183",
2024-10-02 10:03:52 +03:00
"name": "InProgress",
"color": "yellow",
"description": null
},
{
2024-10-09 09:42:00 +03:00
"id": "1b214a08-6768-4381-b3cb-d8dd88250f8c",
2024-10-02 10:03:52 +03:00
"name": "Remote",
"color": "red",
"description": null
}
]
}
},
2024-10-08 20:15:58 +03:00
"User": {
2024-10-09 09:42:00 +03:00
"id": "%7B%3Bsu",
2024-10-08 20:15:58 +03:00
"name": "User",
"type": "people",
"people": {}
},
"Image": {
2024-10-09 09:42:00 +03:00
"id": "%7B%3F%5B%3F",
2024-10-08 20:15:58 +03:00
"name": "Image",
"type": "files",
"files": {}
},
2024-10-02 10:03:52 +03:00
"Name": {
"id": "title",
"name": "Name",
"type": "title",
"title": {}
}
},
"parent": {
"type": "page_id",
"page_id": "5dd94c34-fab0-4bff-986b-7511c0779f77"
},
2024-10-09 09:42:00 +03:00
"url": "https://www.notion.so/11a82aa7fc4e8138a724ee8786147d82",
2024-10-02 10:03:52 +03:00
"public_url": null,
"archived": false,
"in_trash": false,
2024-10-09 09:42:00 +03:00
"request_id": "2db0d0b9-71b2-45a9-87bc-e25489f09cf3"
2024-10-02 10:03:52 +03:00
}
```