Transformation Operations
Transformation Operations Documentation
The following operations can be used within the transformation mapping by setting the type to "operation" and specifying the name and parameters.
map
mapMaps a source value to a different destination value based on a predefined dictionary.
Parameters
| Field | Type | Description |
|---|---|---|
source_path | string | The JSON path to the source value to be mapped. |
map | array | An array of objects, each containing a from and to key. The from key is a regular expression to match against the source value. |
alt | string | An alternative value to use if no match is found in the map. |
Example
hash
hashGenerates a hash from the concatenated values of one or more fields.
Parameters
| Field | Type | Description |
|---|---|---|
fields | array | A list of JSON paths to the fields whose values will be concatenated and hashed. |
type | string | The hashing algorithm to use. Supported values are "MD5" and "SHA-256" (default). |
format | string | The output format for the hash. Supported values are "hexadecimal" or a GUID format for MD5. Defaults to the standard string representation of the hash. |
Example
concat
concatJoins the string values of multiple fields together.
Parameters
| Field | Type | Description |
|---|---|---|
fields | array | A list of JSON paths to the fields whose values will be concatenated. |
separator | string | A string to insert between each value. Defaults to an empty string. |
Example
format
formatCreates a formatted string from the values of one or more fields.
Parameters
| Field | Type | Description |
|---|---|---|
fields | array | A list of JSON paths to the fields whose values will be used in the format string. |
format | string | A standard .NET format string (e.g., "Name: {0}, Age: {1}"). |
Example
extract
extractExtracts a value from a string using a regular expression.
Parameters
| Field | Type | Description |
|---|---|---|
source_path | string | The JSON path to the source string. |
regex | string | The regular expression to use for extraction. This is specified in the top-level format property of the mapping. |
format | string | An optional format string to combine multiple regex capture groups. This is specified in the top-level destination_format property of the mapping. If the value is "{*" all matches will be appended to the destination array. |
Example
trim_array
trim_arrayRemoves null or empty values from an array.
Parameters
| Field | Type | Description |
|---|---|---|
source_path | string | The JSON path to the source array. |
destination_format | string | A string containing "empty" and/or "null" to specify which values to remove. Defaults to both. |
Example
key_to_value
key_to_valueTransforms an object with dynamic keys into an array of objects.
Parameters
| Field | Type | Description |
|---|---|---|
source_path | string | The JSON path to the source object. |
key_name | string | The name of the new property that will hold the original key. |
value_name | string | The name of the new property that will hold the original value. If the original value is an object, this can be omitted and the key property will be added to the object. |
Example
Given the source: {"metrics": {"clicks": 10, "views": 100}}
i18n_language_shorthand
i18n_language_shorthandConverts a full language name (e.g., "English") to its two or three-letter ISO code.
Parameters
| Field | Type | Description |
|---|---|---|
source_path | string | The JSON path to the source language name. |
format | string | The desired output format. Supported values are "two_letter_code" (default) and "three_letter_code". This is specified in the top-level destination_format property. |
Example
Updated about 2 hours ago
