"createIntegrationTable" (JSON Action)
JSON hub "createIntegrationTable action creates a new integration table in FairCom Edge
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
{
"api": "hub",
"action": "createIntegrationTable",
"params": {
"tableName": "test1"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}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"
}{
"api": "hub",
"apiVersion": "1.0",
"requestId": "2",
"action": "createIntegrationTable",
"params": {
"databaseName": "faircom",
"tableName": "test2",
"fields": [
{
"name": "t10",
"type": "VARCHAR",
"length": 128,
"nullable": true
}
],
"metadata": { },
"retentionPeriod": 4,
"retentionUnit": "week"
},
"apiVersion": "1.0",
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}{
"result": {},
"requestId": "1",
"errorCode": 0,
"errorMessage": ""
}{
"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"
}Use the createIntegrationTable JSON API action to create a new integration table in FairCom Edge
The "params" property is an object that contains an action's request parameters as defined by a set of properties. Each action defines its own required and optional properties. See System limits for a comprehensive overview of property requirements and limitations.
"params" property summariesProperty | Description | Default | Type | Limits (inclusive) | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(optional) specifies the name of a database. | Defaults to the | string | 1 to 64 bytes | ||||||||||||||||||||||
(optional) contains objects that specify the settings of a field in a table. |
| array | |||||||||||||||||||||||
| (optional) controls when and how the server automatically sets the field value. |
| string |
| |||||||||||||||||||||
| (optional) specifies the default value of a field. |
| string | 0 to 65,500 bytes | |||||||||||||||||||||
| (optional) specifies the length of a field's value in a record. |
| integer |
| |||||||||||||||||||||
| specifies a new name of the field. | Required - No default value | string | 0 to 64 bytes | |||||||||||||||||||||
| (optional) allows a field to contain a NULL value when |
| Boolean |
| |||||||||||||||||||||
| (optional) adds a field to the specified ordinal position of the table's primary key when > 0. |
| integer |
| |||||||||||||||||||||
| (optional) specifies the number of places to the right of the decimal point. |
| integer |
| |||||||||||||||||||||
| specifies the type of field. | Required - No default value | string |
| |||||||||||||||||||||
(optional) exists primarily for the user interface to find integration information. |
| object | May contain any number and type of user-defined properties | ||||||||||||||||||||||
(optional) controls how messages are persisted. |
| string |
| ||||||||||||||||||||||
(optional) specifies the number of retention units, which controls how long data is retained – see |
| integer |
| ||||||||||||||||||||||
(optional) purges expired messages each time this unit cycles – see |
| string |
| ||||||||||||||||||||||
specifies the name of a table. | Required - No default value | string | 1 to 64 bytes | ||||||||||||||||||||||
(deprecated) specifies the name of a transform process you have created. Replaced by the "transformSteps" property. |
| string | 1 to 64 bytes | ||||||||||||||||||||||
specifies an array of transform objects. | Required - No default value | array of objects | 0 or more objects | ||||||||||||||||||||||
| specifies the name of a code package that runs when a record is inserted into an integration table. | Required - No default value | string | 1 to 64 bytes | |||||||||||||||||||||
| (optional) specifies the database that contains an object, such as a table or code package. |
| string | 1 to 64 bytes | |||||||||||||||||||||
| (optional) specifies the account that owns an object, sucha s a table or code package. |
| string | 1 to 64 bytes | |||||||||||||||||||||
| (optional) specifies field in the table to be mapped to a field containing JSON properties. |
| array |
| |||||||||||||||||||||
| (optional) specifies how binary values are returned. |
| string |
| |||||||||||||||||||||
| (optional) specifies the format of a date or a datetime embedded in a JSON string. |
| string enum |
| |||||||||||||||||||||
| specifies the name of a field in a table. | Required - No default value | string | 1 to 64 bytes | |||||||||||||||||||||
| (optional) specifies how numbers are formatted in the JSON response message. |
| string |
| |||||||||||||||||||||
| specifies the location in a record where the server reads or writes a JSON value. | Required - No default value | string | 0 to 256 bytes | |||||||||||||||||||||
| (optional) specifies how to interpret JSON strings and numbers as time fields. |
| string |
| |||||||||||||||||||||
| (optional) specifies how the server will represent the values of variant fields in its response to your request. |
| string |
| |||||||||||||||||||||
| (optional) specifies the name of the database that contains the target table. |
| string | 1 to 64 bytes | |||||||||||||||||||||
| (optional) specifies the name of the account that owns the target table. |
| string | 1 to 64 bytes | |||||||||||||||||||||
| (optional) specifies the name of the target table. |
| string | 1 to 64 bytes | |||||||||||||||||||||
| specifies the transform method the step will use. | Required - No default value | string enum |
| |||||||||||||||||||||
| (optional) specifies the name that will be assigned to each transform step. |
| string | 1 to 64 bytes | |||||||||||||||||||||
| (optional) specifies the name of a transform service, which is the user-defined name for a library (.dll, .so, .dylib) that implements the transform step method. |
| string | 1 to 64 bytes |
The "databaseName" property is an optional string that specifies the database that contains the tables. It defaults to the database name supplied at login.
Note
In the API Explorer, "defaultDatabaseName" is set to "ctreeSQL" in the "createSession" action that happens at login.
A zero-length
"databaseName"is invalid.Its length limit is from 0 to 64 bytes.
If the
"databaseName"property is omitted or set tonull, the server will use the default database name specified at login.If no default database is specified during
"createSession","databaseName"will be set to the"defaultDatabaseName"value that is specified in theservices.jsonfile.
"params": {
"databaseName": "mainDatabase"
}
The "fields" property is an array of objects. It is required when creating a table. Each object in the array defines a field by specifying its properties.
Example
"fields": [
{
"autoValue": "none",
"name": "name",
"type": "varchar",
"length": 50,
"scale": null,
"defaultValue": null,
"nullable": false
}
]The "metadata" property is an optional JSON object. It exists primarily for the user interface to find integration information. By default, it is an empty JSON object.
It contains a flexible set of properties.
It typically contains tags and description properties.
Example
{
"description": "",
"tags": [""],
"yourOwnProperties": "usage, purpose, notes, location, etc.",
}
The "retentionPolicy" property controls how messages are persisted. This property is optional.
If not specified, the default found in the services.json file is used. Initially, it is "autoPurge".
retentionPolicy values:"autoPurge"This is the default. It is automatically applied when a new topic is created. It is preferred because it allows FairCom's servers to automatically remove messages that are older than the retention time. This helps ensure message data does not consume all storage space. It also minimizes storage costs and speeds up data access. The server partitions a table into multiple files so it can efficiently delete expired files.
"neverPurge"This stores messages on disk and never removes them. This is useful when you need the entire history of the message stream. If message velocity is high, this can consume all storage space and cause an outage. The server creates a non-partitioned table, which is slightly faster than a partitioned table because it stores all records in one file.
The "retentionPeriod" property specifies how many units of data to retain. It must be an integer value from 1 to 100. It refers to the unit of time specified by the "retentionUnit" property — for example, if "retentionPeriod" is 14 and "retentionUnit" is "day", then message data is retained for 14 days. This property is optional.
Periodically, the system increments the age of each table partition.
"Minute"units are incremented at the zero second of each minute, whether the table partition was created 1 second before or 59 seconds before."Day"units are incremented at midnight GMT, not midnight of the local UTC time zone. A table partition becomes one day old at midnight GMT, whether it was created one second before or 23 hours and 59 seconds before."Week"units are incremented at midnight GMT on the last day of each week, even if the table partition was created one second before. The last day of the week is Saturday GMT."Month"units are incremented at midnight GMT on the last day of each month."Year"units are incremented at midnight GMT on Dec 31.
"retentionPeriod"implicitly calculates an upper bound on how many partitions are able to accumulate on your hard drive. However, partitions are not deleted just because this calculated number of partitions is reached. The system also does not restrict the deletion of all partitions.If the FairCom database is shut down for a month, when the database is started up again, all partitions that are retained for less than one month are immediately deleted.
If someone purposely or accidentally sets the date to a future date, all partitions immediately become older, and auto-deletion ensues accordingly.
When partitions are auto-purged, some data are maintained "forever" in a global index. Auto-purge does not prevent these files from growing without bounds and filling up your hard drive.
If not specified, the default found in the services.json file is used. Initially, it is 4 (weeks).
Automatically purging data is important to ensure that retained data does not consume all storage and shut down the computer. The default value of 4 weeks allows FairCom's servers to store 1 TB of messages when 200 topics send one 2K message per second.
Note
If the value is not an integer from
1to100, FairCom's servers set it to the default value.Smaller numbers improve SQL performance.
Each time the
"retentionPeriod"cycles, FairCom's servers automatically and efficiently delete expired data.The
"retentionUnit"and"retentionPeriod"properties are used only when the"retentionPolicy"is set to"autoPurge".FairCom's servers only use the
"retentionPeriod"property when the"retentionPolicy"is"autoPurge".The
"retentionPeriod"can be changed to retain fewer or more messages. Changing it does not necessarily destroy existing data, but data may expire more quickly or be retained longer.The
"retentionPeriod"and"retentionUnit"properties control data granularity as well as the retention time. In other words,"retentionPeriod"defines how many sets of data are stored, and"retentionUnit"defines how often data is purged.For example, if
"rententionPeriod"is set to14, the server stores 14 sets of data. At the beginning of the 15th cycle, the server automatically purges the oldest set of data. If"retentionUnit"is set today, then data will be purged daily. If set to"week", then data will be purged weekly.The current calendar date affects purging.
FairCom's servers automatically purge all retained data that has expired. This is noticeable when FairCom's servers come online after having been offline for a long time. When a server comes back online, it automatically purges all expired data.
For example, if a FairCom server is offline for four weeks when it comes online, it will completely purge all retained data that has a retention time of less than 4 weeks.
Each time this unit cycles, FairCom purges expired messages. For example, if you want a week's worth of messages to be purged once a week, set "retentionUnit" to "week" . This property is optional.
If not specified, the default found in the services.json file is used. Initially, it is "week".
This property is used in concert with
"retentionPeriod"to determine retention time."retentionUnit"values:"minute""hour""day""week""month""year""forever"
Note
For best performance, set the
"retentionUnit"to a value that keeps"retentionPeriod"between5and30.When you set
"retentionUnit"property to"forever"the server will not purge messages. This setting is the same as setting"retentionPolicy"to"neverPurge".The
"retentionUnit"and"retentionPeriod"properties are used only when the"retentionPolicy"is set to"autoPurge".
The "tableName" property contains the name of the table in the database where the event occurred. It is a non-zero-length string.
See table name in System limits for table naming requirements and limitations.
A table in DBnotify is defined by "databaseName", "ownerName" and "tableName" or by "dataFilePath".
This optional property indicates when and how the server automatically sets the field value.
Only one of these values is allowed per field.
"none"indicates that the server does not automatically set the field's value."incrementOnInsert"indicates that the server automatically increments a field’s value each time the server inserts a new record. It applies to fields that are of the type of decimal or one of the integer types, such as"bigint". Only one field per table can have this attribute. The server returns an error when assigning this attribute to multiple fields. The JSON DB API automatically creates the"id"field as an"incrementOnInsert"field. If you apply this attribute to another field, it becomes the only automatically incremented field in the table. If you want that field to be the primary key, assign"primaryKey": 1to it."timestampOnInsert"indicates that the server automatically sets a field’s value to the current date and time of an insert. It applies only to fields with a type of"timestamp".Note
If you attempt to insert a record and specify a timestamp for a field that has
"autoValue"set to"timestampOnInsert", the timestamp you specified is ignored, and the current date and time are assigned to the field."timestampOnUpdate"indicates that the server automatically sets a field’s value to the current date and time of an update. This setting applies only to timestamp fields."timestampOnUpdateAndInsert"indicates that the server automatically sets a field’s value to the current date and time of an insert and an update. It applies only to fields with a type of"timestamp"."changeId"indicates the server uses the field for optimistic locking. The server automatically sets the field's value to the internal transaction number used during the last update of the record. This value changes each time the server updates the record. A table may only have one change tracking field. The field type must be"bigint".The JSON DB API automatically creates a
"changeid"field with change-tracking functionality.Change tracking is optional in the CTDB and ISAM APIs. The application must create a 64-bit integer field and assign change-tracking functionality to it.
Request Example
"fields": [
{
"name": "signed_int32",
"type": "integer",
"autoValue": "incrementOnInsert"
}
]
Response Example
{
"result": {
"dataFormat": "objects",
"data": [
{
"changeIdField": "changeId",
"createRecByteIndex": false,
"databaseName": "ctreeSQL",
"fieldDelimiterValue": 0,
"fields": [
{
"autoValue": "incrementOnInsert",
"defaultValue": null,
"length": null,
"name": "signed_int32",
"nullable": true,
"primaryKey": 0,
"scale": null,
"type": "integer"
}
]
}
]
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
The "transformSteps" property is an array of transform step objects.
Different actions interpret "transformSteps": [] differently.
In the
"alterIntegrationTable"action,"transformSteps"is optional. Setting it to[]removes transform steps from the integration table.In the
"createIntegrationTable"action,"transformSteps"is optional. Setting it to[]is the same as setting it tonullor omitting it.In the
"testIntegrationTableTransformSteps"actions,"transformSteps"is required; thus, omitting it or setting it to[]ornullis an error.
Each transform step object contains the required "transformStepMethod" property. It also supports the following optional properties:
"transformStepName""transformStepService"
Each transform step method also supports unique properties that are defined below.
"transformStepMethod": "javascript"
Required properties
"codeName"
Optional properties
"ownerName""databaseName"
"transformStepMethod": "tableFieldsToJson"
Required properties
"mapOfPropertiesToFields"
"transformStepMethod": "jsonToTableFields"
Required properties
"mapOfPropertiesToFields"
"transformStepMethod": "jsonToDifferentTableFields"
Required properties
"mapOfPropertiesToFields""targetTableName"
Optional properties
"targetOwnerName""targetDatabaseName"
The "codeName" property is a required string from 1 to 64 bytes. It is the name of a code package that runs when a record is inserted into an integration table. See "codeName" for more information.
It is an error to set "codeName" to the empty string "".
The "databaseName" property is an optional string from 1 to 64 bytes that specifies the database that contains an object, such as a table or code package. If it is set to null or is omitted, it defaults to the default database of the JSON Action session, see "createSession" and the "defaultDatabaseName" property.
You specify this property when you want to use a different database instead of the default. Your session's account must have the appropriate privileges to access the code package.
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 "dev", "test", "stage", and "prod" databases on the same server and use the "defaultDatabaseName" or "databaseName" properties to specify the desired environment.
It is an error to set "databaseName" to the empty string "".
If no default database is specified during "createSession", the server sets the "defaultDatabaseName" to the "defaultDatabaseName" value specified in the services.json file.
The "ownerName" property is an optional string from 1 to 64 bytes that specifies the account that owns an object, such as a table or code package. If it is set to null or is omitted, it defaults to the account that created the JSON Action session, see "createSession" and the "defaultOwnerName" property.
You specify this property when you want to use a different account instead of the default. Your session's account must have the appropriate privileges to access the code package.
This property is useful because objects, such as tables and code packages, can have the same name in the same database as long as different accounts own each object. This feature allows you to create duplicate objects for different users on the same server and reuse the same JSON actions on those objects. For example, an administrator can copy objects from a production environment to her account so she can troubleshoot an issue using the same JSON actions, JavaScript, and SQL code.
It is an error to set "ownerName" to the empty string "".
If no default owner is specified during "createSession", the server sets the "defaultOwnerName" to the "defaultOwnerName" value specified in the services.json file.
The "mapOfPropertiesToFields" property takes fields in the table and maps them to a field containing JSON properties. It is an array of property map objects. Each object maps a field in a table to a JSON property in another field.
Required properties
"recordPath""fieldName"
Optional properties
"binaryFormat""numberFormat""variantFormat""dateFormat""timeFormat"
The optional "dateFormat" property specifies the format of a date or a datetime embedded in a JSON string. It applies to user-provided JSON and to server-generated JSON. The server uses it when it needs to transform or convert a date or datetime embedded in a JSON string into a FairCom date or timestamp. It also uses it when it needs to convert a date or datetime field value into a date embedded in a JSON string.
It is an enumerated string with one of the following values: "ccyy.mm.dd", "mm.dd.ccyy", "mm.dd.yy", "dd.mm.ccyy", "dd.mm.yy", "ccyymmdd", "yymmdd", "iso8601", and "utc".
The default value for "dateFormat" is the "defaultDateFormat" property defined in the "createSession" or "alterSession" actions. If it is omitted there, it defaults to the value of the "defaultDateFormat" property in the <faircom>/config/services.json file. If it is not there, the FairCom server defaults it to "iso8601" because the ISO8601 date is the defacto standard in JSON.
The enumerated string defines how the server parses a date in a JSON string and how it writes a date into a JSON string. The following key explains the parts of each enumerated value:
ccyyis a four-digit year (0000-9999).yyis a two-digit year (00-99).mmis a two-digit month (01-12).ddis a two-digit day of the month (01-31).hhis a two-digit hour (00-23)..represents one character that can be one of the following values:/,., or-."utc","iso8601", and"ccyy.mm.dd"are the same.
The required "fieldName" property specifies a field in a record. Depending on the context, the server reads or writes the field's value.
For example, in the "tableFieldsToJson" transform method, "fieldName" is the location where the transform step reads a value that it transforms. In the "jsonToTableFields" and "jsonToDifferentTableFields" transform methods, "fieldName" is the location where the transform step writes a transformed value.
The "numberFormat" property is an optional, case-insensitive string enum. It defines the format of JSON numbers. The default value for "numberFormat" is the "defaultNumberFormat" defined in the "createSession" or "alterSession" actions. If it is omitted there, it defaults to the value of the "defaultNumberFormat" property in the <faircom>/config/services.json file.
When "numberFormat" occurs in "mapOfPropertiesToFields", it tells the server how to encode or decode a number assigned to a JSON property.
For example, including "numberFormat" in a "tableFieldsToJson" transform step controls if the server encodes a number in a JSON property as a number or a number embedded in a string.
"number"This causes the server to return numeric values as JSON numbers, such as
-18446744073709551616.000144722494.This is most efficient.
JSON represents numbers are base-ten numbers that may have any number of digits.
Large numbers, such as
18446744073709551616.000144722494are known to cause problems with JSON parsers and some programming languages, such as JavaScript, which are limited to the smaller range and binary rounding errors of IEEE floating point numbers."string"This returns the server to embed numeric values in JSON strings, such as
"18446744073709551616.000144722494".This is slightly less efficient because it includes two extra double quote characters
Returning numbers embedded in strings ensures JSON parsers and programming languages will not automatically convert the number to a numeric representation that loses precision, introduces rounding errors, truncates values, or generates errors. This allows your application to control how numbers are processed.
Omitted or set to
nullThis defaults to
"number".
Example request
{
"action": "someAction",
"responseOptions":
{
"numberFormat": "string"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
The "recordPath" property specifies the location in a record where the server reads or writes a JSON value. It specifies a field name followed by an optional JSONPath. Depending on the context, it refers to a value the server reads or writes.
For example, in the "tableFieldsToJson" transform method, "recordPath" is the location where the transform step writes a transformed value. In the "jsonToTableFields" and "jsonToDifferentTableFields" transform methods, "recordPath" is the location where the transform step reads the value that it transforms.
The
"recordPath"property must always include a field name.The server returns an error when the field name is missing or does not exist.
The
"recordPath"property may include a JSONPath after the field name.If no JSONPath follows the field, the
"recordPath"property refers to the entire field, and the field is not required to contain a JSON document.If a JSONPath follows the field, the
"recordPath"property refers to a part of the JSON document inside the field.
Several FairCom APIs, such as the DB and Transform APIs, treat each record in each table as a JSON document. The top-level fields in the record are treated as top-level properties in the JSON document. In other words, you can think of each record as a JSON document, and you can use the "recordPath" property to refer to any field in the record and any JSON property or array item within a JSON field.
When the server writes a value to a "recordPath", it looks for the specified field and JSONPath and does the following.
If the specified field does not exist, the server returns an error.
If the JSONPath is not specified after the fieldname, the server writes the value directly to the field.
If the field's value does not contain a JSON document, the server returns an error.
If the JSONPath specifies a property or array item that does not exist in the field's JSON document, the server adds it.
If the JSONPath specifies a property or array item that already exists in the field's JSON document, the server replaces the value.
When the server reads a value from a "recordPath", it looks for the specified field and JSONPath and does the following.
If the specified field does not exist, the server returns an error.
If the JSONPath is not specified after the fieldname, the server reads the entire field value.
If the field's value does not contain a JSON document, the server returns an error.
If the JSONPath specifies a property or array item that does not exist in the field's JSON document, the server returns
nullbecause FairCom's data model treats a missing JSON property the same as one assigned tonull.If the JSONPath specifies a property or array item that already exists in the field's JSON document, the server replaces the value.
Note
Unlike "propertyPath", a "recordPath" includes the name of the field that contains the JSON document.
Simple "recordPath" example
For example, a recordPath of "temperature" refers to a field named "temperature".
Example record in an integration table
The following record contains three fields: id, source_payload, and create_ts.
id | source_payload | create_ts |
|---|---|---|
| {
"humidity":
[
{
"temperature": 20.1,
"pressure": 1003
}
]
}
|
|
JSON representation of the example record
The following JSON shows how the JSON DB and Transform APIs represent the previous record. The top-level properties are fields in the integration table.
{
"id": 1,
"source_payload":
{
"humidity":
[
{
"temperature": 20.1,
"pressure": 1003
}
]
},
"create_ts": "2025-07-07T14:14:02.012"
}
"recordPath" properties for each value in the example record
"recordPath" | Field Value |
|---|---|
|
|
| {
"humidity":
[
{
"temperature": 20.1,
"pressure": 1003
}
]
}
|
| [
{
"temperature": 20.1,
"pressure": 1003
}
]
|
| {
"temperature": 20.1,
"pressure": 1003
}
|
|
|
|
|
|
|
The required "recordPath" property specifies the location of a JSON property in a record. It starts with the name of a field in the table followed by an optional JsonPath to a JSON property within that field.
The optional "timeFormat" property specifies the format of a time or a datetime embedded in a JSON string. The server uses it when it needs to transform or convert a time or datetime embedded in a JSON string into a FairCom time or timestamp. It also uses it when it needs to convert a time or datetime field value into a time embedded in a JSON string.
It is an enumerated string with one of the following values: "hh.mm.ss.ttt", "hh.mm.am/pm", "hh.mm.ss.am/pm", "hh.mm.ss", "hh.mm", "hhmm", "iso8601", and "utc".
The default value for "timeFormat" is the "defaultTimeFormat" property defined in the "createSession" or "alterSession" actions. If it is omitted there, it defaults to the value of the "defaultTimeFormat" property in the <faircom>/config/services.json file. If it is not there, the FairCom server defaults it to "iso8601" because the ISO8601 date is the defacto standard in JSON.
The enumerated string defines how the server parses a time in a JSON string. The following key explains the parts of each enumerated value:
hhis a one- or two-digit hour (0-24).mmis a two-digit minute (00-59).ssis a two-digit second (00-59).tttis a fraction of a second with up to 3 digits of precision (.0-.999)..represents one character that can be one of the following values::,.,-, or/."utc","iso8601", and"hh.mm.ss.ttt"are the same.
The optional "variantFormat" property specifies how the server represents variant fields in JSON. It is an enumerated string with one of the following values: "binary", "json", "string", and "variantObject".
The default value for "variantFormat" is the "defaultVariantFormat" property defined in the "createSession" or "alterSession" actions. If it is omitted there, it defaults to the value of the "defaultVariantFormat" property in the <faircom>/config/services.json file. If it is not there, the FairCom server defaults it to "json".
When "variantFormat" occurs in "mapOfPropertiesToFields", it tells the server how to encode or decode a variant value in a JSON property.
For example, including "variantFormat" in a "tableFieldsToJson" transform step controls how the server takes the value in a variant field and encodes it in a JSON property. By default, the server takes the variant value and stores it as JSON in the JSON property.
For example, including "variantFormat" in a "jsonToTableFields" or "jsonToDifferentTableFields" transform step controls how the server decodes a value in a JSON property so it can store that value in a variant field. By default, the server takes the value and stores it as JSON in the variant field.
The "json" value causes the server to return a variant field value as JSON or to store JSON in the variant field.
When a variant is
null, it always sets the JSON value tonull.JSON provides a natural representation for most values, such as
null,true,false,3.14,"mystring",[1,2],{"myKey": "myValue"}, etc.JSON does not have a native representation for binary values. Thus, when a variant field contains a binary value, the
"binaryFormat"property specifies how the server represents it in JSON, which may be a Base64 or hexadecimal string, such as"486921", or a JSON array of bytes, such as[48,69,21].
The "string" value causes the server to return a variant field value as a JSON string or to store a JSON string value in the variant field.
When a variant is
null, it always sets the JSON value tonull.When a variant contains a numeric value, it embeds the number in a string, such as
"3.14".When a variant contains a Boolean value, it embeds it in a string, such as
"true"or"false".When a variant contains a JSON value, it embeds it in a string by escaping characters, such as
"{\"key\": \"value\"}".A JSON string can represent a binary value. Thus, when a variant field contains a binary value, the
"binaryFormat"property specifies how the server represents it in JSON, which may be a hexadecimal or Base64 string.When you use
"variantFormat":"string", you may not use"binaryFormat":"byteArray"because the value must be a string.
The "binary" value causes the server to return a variant field value as a binary value in JSON or to store a binary value in the variant field.
When a variant is
null, it always sets the JSON value tonull.The
"binaryFormat"property specifies how the server represents the binary variant value in JSON, which may be a Base64 or hexadecimal string, such as"486921", or a JSON array of bytes, such as[48,69,21].
The "variantObject" value causes the server to return a variant field value as a variant object or to store a value in a variant field as specified by the variant object, which is a standard JSON object that describes the variant value's type, encoding, and value.
When a variant is
null, it always sets the JSON value tonull.Because JSON cannot directly represent a binary value, the
"binaryFormat"property specifies how the variant object represents it, which may be a Base64 or hexadecimal string, such as"486921", or a JSON array of bytes, such as[48,69,21].
{
"schema": "jsonaction.org/schemas/variantObject",
"value": "ewogICJrZXkiOiAidmFsdWUiCn0=",
"valueEncoding": ["base64"],
"type": "binary"
}The "targetDatabaseName" property is the optional name of the database that contains the target table. See
"databaseName" for more information.
The "targetOwnerName" property is the optional name of the account that owns the target table. See "ownerName" for more information.
The required "targetTableName" property specifies the name of the target table that has its transform steps replaced by this action.
Note
The fully qualified name of a table includes the database, owner, and table names.
The "transformStepMethod" property is a required string that 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.
Note
The "transformStepMethod" property replaces the deprecated "transformActionName" property.
The value of the "transformStepMethod" affects the value of the "transformService" property. The following table defines the possible values of the "transformService" property when combined with the "transformStepMethod". Notice that some transform step methods are built into the server and do not require you to specify the "transformService".
|
|
|---|---|
|
|
|
|
|
|
|
|
|
|
Note
If the "transformStepMethod" property is set to "javascript", the "transformService" property must be set to "v8TransformService".
The "transformStepName" property is an optional string that assigns a name to each transform step.
The "transformStepService" property is an optional string that specifies the name of a transform service, which is the user-defined name for a library (.dll, .so, .dylib) that implements the transform step method.
This property allows you to register your own transform libraries or use an older version of a FairCom library for backward compatibility.
Transform services are defined in the services.json file under the "transformServices" section. You can add and remove transform libraries to this list, such as your own transform libraries or specific versions of FairCom's transform libraries. Use the "serviceName" property to give each transform library a unique transform service name and use the "serviceLibrary" property to specify the filename of the library that implements the transform step method. On Windows the library filename ends with .dll. On Linux it ends with .so. On MacOS it ends with .dylib. Lastly, you must enable the transform service by setting "enabled" to true.
Example "transformServices" section in the services.json file.
"transformServices": [
{
"serviceName": "v8TransformService",
"serviceLibrary": "v8transformservice.dll",
"enabled": true
}
],Note
If the "transformStepMethod" property is set to "javascript", the "transformStepService" property must be set to "v8TransformService" or to a user-defined transform service name associated with the "v8transformservice.dll" service library.