JSLT block
The jslt_transform block applies a JSLT transformation to JSON data as a transformation block in a Connect+ dataflow. JSLT is an open-source query and transformation language for JSON. The block accepts a JSLT expression that defines how the input JSON is restructured or mapped before being passed to downstream blocks. The block name must be alphanumeric.
When to use this block
Use this block when your dataflow needs to restructure, filter, or remap a JSON payload before it is passed to the destination, for example, renaming fields, extracting nested values, or reshaping the payload structure.
Prerequisites
Before configuring this block, make sure you have a JSLT transformation expression prepared for your use case
Standard properties
| Field name | Required | Description |
|---|---|---|
| Block name | No | A name for the block instance. The name must be alphanumeric. There is no character limit. |
| JSLT Transformation | Yes | The JSLT expression used to transform the input JSON data. Enter the transformation template in the code editor. |
| Send each record separately | No | Determines whether each record is sent as a separate API request.
true. |
Advanced properties
⚠️ Advanced properties for JSLT JSON Transform. Make changes only if you know what you are doing.
| Field name | Required | Description |
|---|---|---|
| Query parameters | No | Defines the key-value pairs that are appended to the API URL when making the request. For each query parameter value:
|
| Attributes | No | Defines the values that can be referenced later in the dataflow for downstream processing, such as API path parameters or additional headers. For each attribute value:
externalId, but the destination API expects the value as userId in the endpoint v2/customers/USERID/labels, create an attribute with userId as the key and externalId as the value. During execution, Connect+ reads the value of externalId from each record and replaces USERID in the API request with that value. |
For details on writing the JSLT expression for different use cases, refer to the Use cases.
When the API expects a single object
Write a direct mapping. The expression maps one flat JSON input to the required nested structure and produces a single output object. Use this for endpoints like /v2/customers, which accept one record per request.
{
"profiles": [
{
"firstName": .firstname,
"lastName": .lastname,
"source": .source,
"identifiers": [
{
"type": .identifierType,
"value": .value
}
]
}
]
}When the API expects an array of objects
Use for (.) at the beginning of the expression. The loop iterates over every row in the input batch and produces one output object per row, wrapping all results into an array. Use this for endpoints like /v2/customers/bulk, which accept multiple records in a single request.
[
for (.)
{
"profiles": [
{
"firstName": .firstname,
"lastName": .lastname,
"source": .source,
"identifiers": [
{
"type": .identifierType,
"value": .value
}
]
}
]
}
]Note: When writing JSLT transformations, handle both null and empty-string values explicitly. If these cases are not handled, Connect+ can omit fields from the API payload, which can cause downstream API validation failures.
For fallback values, use conditions such as is-null(field) along with field == "" when required.
Updated 17 days ago
