2024-06-07 11:53:24 +00:00
|
|
|
---
|
|
|
|
sidebar_position: 1
|
|
|
|
---
|
|
|
|
|
|
|
|
# Create field
|
|
|
|
Creates a new field in the table
|
|
|
|
|
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
`Function CreateField(Val Token, Val Base, Val Table, Val FieldStructure) Export`
|
2024-06-07 11:53:24 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
| Parameter | CLI option | Type | 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-06-07 11:53:24 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Airtable
|
2024-06-07 11:53:24 +00:00
|
|
|
|
2024-07-10 14:05:58 +03:00
|
|
|
<br/>
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-07 11:53:24 +00:00
|
|
|
```bsl title="Code example"
|
2024-10-02 20:28:02 +03:00
|
|
|
Token = "patNn4BXW66Yx3pdj.5b93c53cab554a8387de02d...";
|
2024-10-13 20:13:25 +03:00
|
|
|
Base = "appESy99HYCLbuWlV";
|
|
|
|
Table = "tbl5gZLQ8i5xKuVTy";
|
2024-10-02 20:28:02 +03:00
|
|
|
Name = String(New UUID);
|
|
|
|
|
|
|
|
Field = OPI_Airtable.GetNumberField(Name);
|
|
|
|
Result = OPI_Airtable.CreateField(Token, Base, Table, Field);
|
2024-06-07 11:53:24 +00:00
|
|
|
```
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-06-07 11:53:24 +00:00
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
oint airtable CreateField --token %token% --base "apptm8Xqo7TwMaipQ" --table "tbl9G4jVoTJpxYwSY" --fielddata %fielddata%
|
2024-06-07 11:53:24 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-10-03 09:45:14 +03:00
|
|
|
{
|
|
|
|
"type": "number",
|
|
|
|
"options": {
|
|
|
|
"precision": 0
|
|
|
|
},
|
2024-10-09 09:42:00 +03:00
|
|
|
"id": "fldDqI1OXajeQw5Gg",
|
|
|
|
"name": "b3fd1280-83b2-4145-838d-3437b14adee3"
|
2024-10-03 09:45:14 +03:00
|
|
|
}
|
2024-06-07 11:53:24 +00:00
|
|
|
```
|