1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-12-24 00:01:24 +02:00
Files
OpenIntegrations/docs/en/md/Airtable/Table-management/Create-table.md

59 lines
1.6 KiB
Markdown
Raw Normal View History

---
sidebar_position: 1
---
# Create table
Creates a new table in the base
2024-07-10 13:58:29 +03:00
`Function CreateTable(Val Token, Val Base, Val Name, Val FieldArray, Val Description = "") Export`
| 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 |
Returns: Map Of KeyAndValue - serialized JSON response from Airtable
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03: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);
```
```sh title="CLI command example"
oint airtable CreateTable --token %token% --base "apptm8Xqo7TwMaipQ" --title %title% --fieldsdata %fieldsdata% --description %description%
```
```json title="Result"
2024-10-02 20:28:02 +03:00
```