1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-05-13 22:16:54 +02:00

81 lines
2.2 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 1
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Create field
Creates a new field in the table
`Function CreateField(Val Token, Val Base, Val Table, Val FieldStructure) Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Token |
| Base | --base | String | ✔ | Base identifier |
| Table | --table | String | ✔ | Table identifier |
| FieldStructure | --fielddata | Structure of KeyAndValue | ✔ | Description of the new field |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Airtable
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-15 10:16:04 +03:00
Token = "patNn4BXW66Yx3pdj.5b93c53cab554a8387de02d...";
2024-11-11 22:11:22 +03:00
Base = "appL0hdxXVnQkbPVh";
Table = "tblEGswvf7vDCgFHd";
2024-10-15 10:16:04 +03:00
Name = String(New UUID);
Field = OPI_Airtable.GetNumberField(Name);
Result = OPI_Airtable.CreateField(Token, Base, Table, Field);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
2024-10-22 08:59:24 +03:00
# JSON data can also be passed as a path to a .json file
2024-10-20 22:36:03 +03:00
oint airtable CreateField \
2024-10-22 08:59:24 +03:00
--token "***" \
2024-11-12 23:15:46 +03:00
--base "app1BSYtCVlNTKWb8" \
--table "tblyiMcHBz46if9ZC" \
--title "0d802851-a0bf-4f39-85da-9217400d3599" \
--fielddata "{'name':'0d802851-a0bf-4f39-85da-9217400d3599','type':'number','options':{'precision':0}}"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
2024-10-22 08:59:24 +03:00
:: JSON data can also be passed as a path to a .json file
2024-10-20 22:36:03 +03:00
oint airtable CreateField ^
2024-10-22 08:59:24 +03:00
--token "***" ^
2024-11-12 23:15:46 +03:00
--base "app1BSYtCVlNTKWb8" ^
--table "tblyiMcHBz46if9ZC" ^
--title "0d802851-a0bf-4f39-85da-9217400d3599" ^
--fielddata "{'name':'0d802851-a0bf-4f39-85da-9217400d3599','type':'number','options':{'precision':0}}"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"type": "number",
"options": {
"precision": 0
},
"id": "fldDqI1OXajeQw5Gg",
"name": "b3fd1280-83b2-4145-838d-3437b14adee3"
}
```