The
jsonToDifferentTableFieldstransform will automatically add the following fields to the target table if they do not already exist. When the transform inserts a new row into the target table, it auto-populates these fields:
change_idcreate_tsidout1out2source_databasesource_idsource_schemasource_tableIf any existing field or index has the same name as one of these but with a mismatched schema definition, the transform will fail and prompt the user to fix this conflict.
Request examples
Minimal
{
"api": "hub",
"apiVersion": "1.0",
"action": "createIntegrationTable",
"params": {
"tableName": "test1",
"fields": [
{
"name": "In1",
"type": "varchar"
}
],
"transformSteps": [
{
"transformStepMethod": "jsonToDifferentTableFields",
"targetTableName": "test_out2",
"mapOfPropertiesToFields": [
{
"recordPath": "in1.out1",
"fieldName": "out1"
}
]
}
]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
The following example is not the maximal example for creating an integration table; rather, it is the maximal example for creating a JSON to different table transform.
{
"api": "hub",
"apiVersion": "1.0",
"action": "createIntegrationTable",
"params": {
"tableName": "test1",
"transformSteps": [
{
"transformStepMethod": "jsonToDifferentTableFields",
"targetTableName": "my_table",
"mapOfPropertiesToFields": [
{
"recordPath": "source_payload.temperature",
"fieldName": "temperature_a"
},
{
"recordPath": "source_payload.temperature",
"fieldName": "temperature_b"
},
{
"recordPath": "source_payload.temperature",
"fieldName": "temperature_c"
}
]
}
]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
tableName |
The See table name in System specifications 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 .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 .targetTableName |
The
|
Optional with default of ""
|
string | 1 to 64 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 |
|
Response examples
Success
{
"result": {},
"requestId": "00000007",
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}