1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-11 11:41:56 +02:00
Vitaly the Alpaca (bot) db385e402e Main build (Jenkins)
2024-11-01 10:29:41 +03:00

99 lines
2.4 KiB
Plaintext

---
sidebar_position: 3
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Create records
Creates one or an array of records by description or an array of field value descriptions
`Function CreatePosts(Val Token, Val Base, Val Table, Val Data) Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Base | --base | String | ✔ | Database identifier |
| Table | --table | String | ✔ | Table identifier |
| Data | --data | Structure, Array of Structure | ✔ | Set or array of sets of pairs Key : Value > Field : FieldValue |
Returns: Map Of KeyAndValue - serialized JSON response from Airtable
<br/>
```bsl title="1C:Enterprise/OneScript code example"
Token = "patNn4BXW66Yx3pdj.5b93c53cab554a8387de02d...";
Base = "appeMvjrOQPJciL7O";
Table = "tblQdiEo3yKV0e1cj";
Number = 10;
String = "Hello";
RowDescription1 = New Structure("Number,String", Number, String);
RowDescription2 = New Structure("Number,String", Number, String);
ArrayOfDescriptions = New Array;
ArrayOfDescriptions.Add(RowDescription1);
ArrayOfDescriptions.Add(RowDescription2);
Result = OPI_Airtable.CreatePosts(Token, Base, Table, ArrayOfDescriptions);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint airtable CreatePosts \
--token "***" \
--base "appk3Fw5gwni4SWYj" \
--table "tblIT2QrATF0xn2YE" \
--data "{'Number':10,'String':'Hello'}"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint airtable CreatePosts ^
--token "***" ^
--base "appk3Fw5gwni4SWYj" ^
--table "tblIT2QrATF0xn2YE" ^
--data "{'Number':10,'String':'Hello'}"
```
</TabItem>
</Tabs>
```json title="Result"
{
"records": [
{
"id": "recVZd6lgdfEkIH0o",
"createdTime": "2024-10-09T06:15:48Z",
"fields": {
"Number": 10,
"String": "Hello\n"
}
},
{
"id": "recenScnS1yuI8Dsk",
"createdTime": "2024-10-09T06:15:48Z",
"fields": {
"Number": 10,
"String": "Hello\n"
}
}
]
}
```