---
sidebar_position: 1
description: Create table and other functions to work with Airtable in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Airtable]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Create table
 Creates a new table in the base



`Function CreateTable(Val Token, Val Base, Val Name, Val FieldArray, Val Description = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Token |
  | Base | --base | String | &#x2714; | Base identifier |
  | Name | --title | String | &#x2714; | New table name |
  | FieldArray | --fieldsdata | Array of Structure | &#x2714; | Array of field descriptions |
  | Description | --description | String | &#x2716; | Table description |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Airtable



```bsl title="1C:Enterprise/OneScript code example"
    Token = "patNn4BXW66Yx3pdj.5b93c53cab554a8387de02d...";
    Base  = "appFSHDVzJPNC6HRO";

    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);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            # JSON data can also be passed as a path to a .json file
            
            oint airtable CreateTable \
             --token "***" \
             --base "app5EEUGKC7EHLcyz" \
             --title "TestTable2" \
             --fieldsdata "[{'name':'Number','type':'number','options':{'precision':'0'}},{'name':'String','type':'richText'},{'name':'Attachment','type':'multipleAttachments'},{'name':'Checkbox','type':'checkbox','options':{'icon':'check','color':'yellowBright'}},{'name':'Date','type':'date','options':{'dateFormat':{'format':'YYYY-MM-DD','name':'iso'}}},{'name':'Phone','type':'phoneNumber'},{'name':'Email','type':'email'},{'name':'Link','type':'url'}]" \
             --description "NewTable"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            :: JSON data can also be passed as a path to a .json file
            
            oint airtable CreateTable ^
             --token "***" ^
             --base "app5EEUGKC7EHLcyz" ^
             --title "TestTable2" ^
             --fieldsdata "[{'name':'Number','type':'number','options':{'precision':'0'}},{'name':'String','type':'richText'},{'name':'Attachment','type':'multipleAttachments'},{'name':'Checkbox','type':'checkbox','options':{'icon':'check','color':'yellowBright'}},{'name':'Date','type':'date','options':{'dateFormat':{'format':'YYYY-MM-DD','name':'iso'}}},{'name':'Phone','type':'phoneNumber'},{'name':'Email','type':'email'},{'name':'Link','type':'url'}]" ^
             --description "NewTable"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "id": "tbl9MIP7k60xewSuH",
 "name": "TestTable2",
 "description": "NewTable",
 "primaryFieldId": "fld59NbisceBcbDru",
 "fields": [
  {
   "type": "number",
   "options": {
    "precision": 0
   },
   "id": "fld59NbisceBcbDru",
   "name": "Number"
  },
  {
   "type": "richText",
   "id": "fldfkkCLQLhSxTGmv",
   "name": "String"
  },
  {
   "type": "multipleAttachments",
   "options": {
    "isReversed": false
   },
   "id": "fldYmelyechhbTTfo",
   "name": "Attachment"
  },
  {
   "type": "checkbox",
   "options": {
    "icon": "check",
    "color": "yellowBright"
   },
   "id": "fld4wXRHU1wbuvIjd",
   "name": "Checkbox"
  },
  {
   "type": "date",
   "options": {
    "dateFormat": {
     "name": "iso",
     "format": "YYYY-MM-DD"
    }
   },
   "id": "fld9NG1JMdfyPW8vY",
   "name": "Date"
  },
  {
   "type": "phoneNumber",
   "id": "fldnUMapkErC0czID",
   "name": "Phone"
  },
  {
   "type": "email",
   "id": "fldWMYFqtMSiTK3gs",
   "name": "Email"
  },
  {
   "type": "url",
   "id": "fldYcFlOm2COOq9hz",
   "name": "Link"
  }
 ],
 "views": [
  {
   "id": "viwlnHWUZO399ze5v",
   "name": "Grid view",
   "type": "grid"
  }
 ]
}
```
