mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-03-31 22:05:13 +02:00
227 lines
5.0 KiB
Plaintext
227 lines
5.0 KiB
Plaintext
---
|
|
sidebar_position: 3
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
# Edit database properties
|
|
Edits properties of an existing database
|
|
|
|
|
|
|
|
`Function EditDatabaseProperties(Val Token, Val Base, Val Properties = "", Val Title = "", Val Description = "") Export`
|
|
|
|
| Parameter | CLI option | Type | Required | 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 |
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Notion
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
Token = "secret_9RsfMrRMqZwqp0Zl0B...";
|
|
Base = "15982aa7-fc4e-81f6-a0b8-fe9d90ac5dd0";
|
|
|
|
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);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
# JSON data can also be passed as a path to a .json file
|
|
|
|
oint notion EditDatabaseProperties \
|
|
--token "***" \
|
|
--base "15782aa7-fc4e-81e4-b9cb-e852c5b99900" \
|
|
--props "{'Email':'rich_text','Website':null}" \
|
|
--title "TestTitle" \
|
|
--description "TestDescription"
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
:: JSON data can also be passed as a path to a .json file
|
|
|
|
oint notion EditDatabaseProperties ^
|
|
--token "***" ^
|
|
--base "15782aa7-fc4e-81e4-b9cb-e852c5b99900" ^
|
|
--props "{'Email':'rich_text','Website':null}" ^
|
|
--title "TestTitle" ^
|
|
--description "TestDescription"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="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"
|
|
}
|
|
```
|