Skip to main content
To transform incoming data into a list or array of objects, you can use this transformer. For example, if a field called Product ID is ingested into the system as follows: Product ID: 1234|09876|23792 Then, although the values are separated by a pipe character, the system identifies it as a single string, which is incorrect. Moreover, storing it as a string restricts proper filtering in the downstream modules. To avoid this, store it as a list or array of strings. However, since the value is not initially in list or array format, the system converts the entire data into a single value and stores it as ProdID(List String) = ["1234|09876|23792"]. To correct this, use the following directives in your transformer:

Directives for Data Transformation

Code
find-and-replace products s/\|/”,”/g
find-and-replace products s/^/[“/g
find-and-replace products s/$/”]/g
parse-as-cdt :product ID APPEND LIST
Below are details of how each directive functions:
DirectiveDescription
`ProdID(List String) = [“12340987623792”]`Converts the String value to list of Strings
find-and-replace products s/|/”,”/gFinds and replaces all occurrences of the pipe character (“”) with commas (”,“)
find-and-replace products s/^/[“/gAdds a double quotation mark (”) at the beginning of each value
find-and-replace products s/$/”]/gAdds a double quotation mark (”) at the end of each value
parse-as-cdt :product ID APPEND LISTReads the “Product ID” field as a list of strings
  • parse-as-cdt: This indicates that the system should interpret or parse the data according to a specified format or structure.

  • ID: Refers to the field or attribute name, in this case, Product ID.

  • APPEND LIST: Specifies that the data in the Product ID field should be treated as a list. This means that values within the field will be parsed and stored as values in a list structure.

As a result, the system stores the Product ID as Product ID: ["1234", "09876", "23792"]. This facilitates straightforward filtering of the values in downstream systems such as Audiences.
Last modified on February 26, 2026