2024-06-05 10:19:46 +00:00
|
|
|
---
|
|
|
|
|
sidebar_position: 1
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
# Create table
|
|
|
|
|
Creates a new table in the base
|
|
|
|
|
|
|
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-07-10 13:58:29 +03:00
|
|
|
`Function CreateTable(Val Token, Val Base, Val Name, Val FieldArray, Val Description = "") Export`
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
| Parameter | CLI option | Type | Description |
|
|
|
|
|
|-|-|-|-|
|
|
|
|
|
| Token | --token | String | Token |
|
|
|
|
|
| Base | --base | String | Base identifier |
|
|
|
|
|
| Name | --title | String | New table name |
|
|
|
|
|
| FieldArray | --fieldsdata | Array of Structure | Array of field descriptions |
|
|
|
|
|
| Description | --description | String | Table description |
|
2024-06-05 10:19:46 +00:00
|
|
|
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
|
Returns: Map Of KeyAndValue - serialized JSON response from Airtable
|
2024-06-05 10:19:46 +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-05 10:19:46 +00:00
|
|
|
```bsl title="Code example"
|
2024-10-02 20:28:02 +03:00
|
|
|
Token = "patNn4BXW66Yx3pdj.5b93c53cab554a8387de02d...";
|
|
|
|
|
Base = "app9bSgL4YtTVGTlE";
|
|
|
|
|
|
|
|
|
|
FieldArray = New Array;
|
|
|
|
|
FieldArray.Add(OPI_Airtable.GetNumberField("Number"));
|
|
|
|
|
FieldArray.Add(OPI_Airtable.GetStringField("String"));
|
|
|
|
|
FieldArray.Add(OPI_Airtable.GetAttachmentField("Attachment"));
|
|
|
|
|
FieldArray.Add(OPI_Airtable.GetCheckboxField("Checkbox"));
|
|
|
|
|
FieldArray.Add(OPI_Airtable.GetDateField("Date"));
|
|
|
|
|
FieldArray.Add(OPI_Airtable.GetPhoneField("Phone"));
|
|
|
|
|
FieldArray.Add(OPI_Airtable.GetEmailField("Email"));
|
|
|
|
|
FieldArray.Add(OPI_Airtable.GetLinkField("Link"));
|
|
|
|
|
|
|
|
|
|
Name = "TestTable2";
|
|
|
|
|
Description = "NewTable";
|
|
|
|
|
|
|
|
|
|
Result = OPI_Airtable.CreateTable(Token, Base, Name, FieldArray, Description);
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|
2024-08-13 15:52:26 +03:00
|
|
|
|
2024-07-10 11:59:55 +03:00
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
|
```sh title="CLI command example"
|
2024-08-13 15:52:26 +03:00
|
|
|
|
|
|
|
|
oint airtable CreateTable --token %token% --base "apptm8Xqo7TwMaipQ" --title %title% --fieldsdata %fieldsdata% --description %description%
|
2024-06-05 10:19:46 +00:00
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```json title="Result"
|
2024-10-02 20:28:02 +03:00
|
|
|
|
2024-06-05 10:19:46 +00:00
|
|
|
```
|