You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-11-27 22:18:36 +02:00
230 lines
5.2 KiB
Plaintext
Vendored
230 lines
5.2 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 3
|
|
description: Edit database properties and other functions to work with Notion in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
|
|
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Notion]
|
|
---
|
|
|
|
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 = "28c82aa7-fc4e-812a-85a6-d7e18ec38bd2";
|
|
|
|
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 "28d82aa7-fc4e-813c-9f5e-ecbe6ad80be3" \
|
|
--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 "28d82aa7-fc4e-813c-9f5e-ecbe6ad80be3" ^
|
|
--props "{'Email':'rich_text','Website':null}" ^
|
|
--title "TestTitle" ^
|
|
--description "TestDescription"
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
{
|
|
"object": "database",
|
|
"id": "28d82aa7-fc4e-813c-9f5e-ecbe6ad80be3",
|
|
"cover": null,
|
|
"icon": null,
|
|
"created_time": "2025-10-15T09:39: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": "2025-10-15T09:39: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": {
|
|
"Active": {
|
|
"id": "%3A%40sm",
|
|
"name": "Active",
|
|
"description": null,
|
|
"type": "checkbox",
|
|
"checkbox": {}
|
|
},
|
|
"Phone": {
|
|
"id": "DKWY",
|
|
"name": "Phone",
|
|
"description": null,
|
|
"type": "phone_number",
|
|
"phone_number": {}
|
|
},
|
|
"Description": {
|
|
"id": "EdER",
|
|
"name": "Description",
|
|
"description": null,
|
|
"type": "rich_text",
|
|
"rich_text": {}
|
|
},
|
|
"Number": {
|
|
"id": "GBhx",
|
|
"name": "Number",
|
|
"description": null,
|
|
"type": "number",
|
|
"number": {
|
|
"format": "number"
|
|
}
|
|
},
|
|
"CreationDate": {
|
|
"id": "JEML",
|
|
"name": "CreationDate",
|
|
"description": null,
|
|
"type": "date",
|
|
"date": {}
|
|
},
|
|
"Email": {
|
|
"id": "K%3Cjm",
|
|
"name": "Email",
|
|
"description": null,
|
|
"type": "rich_text",
|
|
"rich_text": {}
|
|
},
|
|
"User": {
|
|
"id": "%5Dopv",
|
|
"name": "User",
|
|
"description": null,
|
|
"type": "people",
|
|
"people": {}
|
|
},
|
|
"Image": {
|
|
"id": "iBvB",
|
|
"name": "Image",
|
|
"description": null,
|
|
"type": "files",
|
|
"files": {}
|
|
},
|
|
"Status": {
|
|
"id": "qljD",
|
|
"name": "Status",
|
|
"description": null,
|
|
"type": "select",
|
|
"select": {
|
|
"options": [
|
|
{
|
|
"id": "0b75fd86-bd5d-4b3f-bf57-1090103376d1",
|
|
"name": "New",
|
|
"color": "green",
|
|
"description": null
|
|
},
|
|
{
|
|
"id": "a3cc9086-34c4-4b73-8eab-ddae9498b164",
|
|
"name": "InProgress",
|
|
"color": "yellow",
|
|
"description": null
|
|
},
|
|
{
|
|
"id": "dc85b516-6ea8-4435-8c48-e623fc013da8",
|
|
"name": "Remote",
|
|
"color": "red",
|
|
"description": null
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"Name": {
|
|
"id": "title",
|
|
"name": "Name",
|
|
"description": null,
|
|
"type": "title",
|
|
"title": {}
|
|
}
|
|
},
|
|
"parent": {
|
|
...
|
|
```
|