The "createIntegrationTable" action creates an integration table.
- The
"createIntegrationTable"action creates an integration table.- This means that it will have the automatically-added integration fields discussed in the Integration fields section, in addition to the fields you explicitly add yourself using the fields property.
- If the table already exists, it returns or logs an error.
- Integration tables are created with input and read privileges only. This enables them for audit trail purposes. Allowing updates and deletions would destroy audit integrity.
Request examples
Minimal
{
"action": "createIntegrationTable",
"params": {
"tableName": "test1"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Create an integration table with a transform
This example creates a new integration table and a transform simultaneously
{
"api": "hub",
"action": "createIntegrationTable",
"params": {
"tableName": "transformExampleTable",
"fields": [
{
"name": "my_input_varchar",
"type": "VARCHAR",
"length": 128,
"nullable": true
},
{
"name": "my_output_field",
"type": "JSON"
}
],
"transformSteps": [
{
"transformStepMethod": "javascript",
"codeName": "transformExample"
},
{
"transformStepMethod": "tableFieldsToJson",
"mapOfPropertiesToFields": [
{
"fieldName": "my_input_varchar",
"recordPath": "my_output_field.myProperty"
}
]
}
]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Create an integration table with one additional field
{
"api": "hub",
"apiVersion": "1.0",
"requestId": "2",
"action": "createIntegrationTable",
"params": {
"databaseName": "faircom",
"tableName": "test2",
"fields": [
{
"autoValue": "none",
"name": "name",
"type": "varchar",
"length": 50,
"primaryKey": null,
"scale": null,
"defaultValue": null,
"nullable": false
}
],
"metadata": { },
"retentionPeriod": 4,
"retentionUnit": "week"
},
"apiVersion": "1.0",
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Response examples
Success
{
"result": {},
"requestId": "1",
"errorCode": 0,
"errorMessage": ""
}Table already exists failure
{
"result": {},
"requestId": "2",
"debugInfo": {
"request": {
"api": "hub",
"action": "createIntegrationTable",
"params": {
"databaseName": "faircom",
"tableName": "test1",
"fields": [
{
"name": "t10",
"type": "VARCHAR",
"length": 128,
"nullable": true
}
],
"metadata": {},
"retentionPeriod": 4,
"retentionUnit": "week"
},
"apiVersion": "1.0",
"requestId": "2",
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
},
"errorCode": 12020,
"errorMessage": "Not able to create integration table [test1]. Integration table name already exists.",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
databaseName |
The You specify this property when you want to use a different database instead of the default. This property is useful because objects, such as tables and code packages, can have the same name in multiple databases. This feature allows you to create multiple environments in the same server and reuse the same JSON actions in each environment. For example, you can create It is an error to set If no default database is specified during |
Defaults to the session's "defaultDatabaseName" property |
string | 1 to 64 bytes |
fields |
The
"fields":
[
{
"name": "name",
"caseInsensitive": true,
"sortDescending": true,
"reverseCompare": false
}
] |
Required - No default value |
array of objects |
|
|
fields .autoValue |
The "autoValue" property indicates when and how the server automatically sets the field value. For more details, see "autoValue". |
Optional with default of "none"
|
string |
|
|
fields .defaultValue |
The "defaultValue" property specifies the default value of a field. It is used when a record is inserted without specifying a value for the field. The server coerces the string value into the proper field type. |
Optional with default of ""
|
string | 0 to 65,500 bytes |
|
fields .length |
The It is required to set the length of the following fixed-length data types:
It is required to set the maximum length for the following variable-length data types:
It is optional to set the maximum length of the It is optional to set the maximum length of the
The
Request example Create a table that contains all field types that use the "fields": [
{
"name": "a",
"type": "char",
"length": 16
},
{
"name": "b",
"type": "varchar",
"length": 65500
} |
Optional with default of null
|
integer |
1 to 65500
|
|
fields .name |
The The The
|
Required - No default value | string | 1 to 64 bytes |
|
fields .nullable |
The "fields": [
{
"name": "company",
"type": "varchar",
"nullable": true
}
] |
Optional with default of true
|
Boolean |
|
|
fields .primaryKey |
The |
Optional with default of null
|
integer |
0 to 32
|
|
fields .scale |
The The value of A scale of The You may optionally use the Example numbers allowed in "number" and "money" field types with a length of 4 and a scale from 0 to 4.
Request Example Create a table that contains all field types that use the "fields": [
{
"name": "j",
"type": "number",
"scale": 32
},
{
"name": "k",
"type": "number",
"scale": 4
} |
Optional with default of null
|
integer |
0 to 32
|
|
fields .type |
The
Request example "fields": [
{
"name": "j",
"type": "number"
}
] |
Required - No default value | string |
|
metadata |
The "metadata" property contains user-defined properties that add keywords and tags about the code package. The server indexes this field with a full-text index so you can search for any word or phrase to find code packages. |
Optional with default of {}
|
object | 0 or more key/value pairs |
retentionPeriod |
The |
Optional with default of |
integer |
1 to 100
|
retentionUnit |
The If not specified, the default found in the
|
Optional with default of |
string |
|
tableName |
The See table name in System limits for the table naming requirements and limitations.
"params": {
"tableName": "ctreeTable"
} |
Required - No default value | string | 1 to 64 bytes |
transformSteps |
The "transformSteps" property specifies an array of transform objects. |
Required - No default value | array of objects |
0 or more objects containing 1 or more of the following properties:
|
|
transformSteps .codeName |
The It is an error to set The package's unique identifier is the combination of |
Required - No default value | string | 1 to 64 bytes |
|
transformSteps .mapOfPropertiesToFields |
The
|
Optional with default of []
|
array |
|
|
transformSteps mapOfPropertiesToFields .fieldName |
The "fieldName" property specifies the name of a field in a table. |
Required - No default value | string | 1 to 64 bytes |
|
transformSteps mapOfPropertiesToFields .recordPath |
The
|
Required - No default value | string | 0 to 256 bytes |
|
transformSteps .transformStepMethod |
The "transformStepMethod" property specifies the type of transform, such as the "javascript" transform method that runs JavaScript to change the table's data, or the "jsonToTableFields" transform method that extracts values from properties in a JSON field and stores them in other fields. For more details, see "transformStepMethod". |
Required - No default value | string enum |
|