Skip to main content

Create records

Creates one or an array of records by description or an array of field value descriptions

Function CreatePosts(Val Token, Val Base, Val Table, Val Data) Export

ParameterCLI optionTypeRequiredDescription
Token--tokenStringToken
Base--baseStringDatabase identifier
Table--tableStringTable identifier
Data--dataStructure, Array of StructureSet or array of sets of pairs Key : Value > Field : FieldValue

Returns: Map Of KeyAndValue - serialized JSON response from Airtable


1C:Enterprise/OneScript code example
    Token = "patNn4BXW66Yx3pdj.5b93c53cab554a8387de02d...";
Base = "appJ6PlCigJQuFxEc";
Table = "tblCBnRh5DcAla8wE";

Number = 10;
String = "Hello";

RowDescription1 = New Structure("Number,String", Number, String);
RowDescription2 = New Structure("Number,String", Number, String);

ArrayOfDescriptions = New Array;
ArrayOfDescriptions.Add(RowDescription1);
ArrayOfDescriptions.Add(RowDescription2);

Result = OPI_Airtable.CreatePosts(Token, Base, Table, ArrayOfDescriptions);
    # JSON data can also be passed as a path to a .json file

oint airtable CreatePosts \
--token "***" \
--base "app7nojXRAvjYjKXT" \
--table "tblFERDiVIU461Lm6" \
--data "{'Number':10,'String':'Hello'}"
Result
{
"records": [
{
"id": "recVZd6lgdfEkIH0o",
"createdTime": "2024-10-09T06:15:48Z",
"fields": {
"Number": 10,
"String": "Hello\n"
}
},
{
"id": "recenScnS1yuI8Dsk",
"createdTime": "2024-10-09T06:15:48Z",
"fields": {
"Number": 10,
"String": "Hello\n"
}
}
]
}