csv to json transformer

CSV to JSON Transformer

Version: 17.01

Supported Since: 17.01

What is a CSV to JSON Transformer?

A CSV to JSON Transformer is a processing element which transforms a CSV message payload to a JSON payload. The CSV payload is expected to adhere to RFC 4180 and it is mandatory to have a header row with field names.

This transformation is done based on a generic set of rules and hence this processing element is most suitable for simple transformations. For complex transformations based on custom rules, Adroitlogic Data Mapping Tool is recommended.

Sample Use Case

In the following use case, the requirement is to read a message with a CSV payload from a SFTP server, convert the message payload to JSON and then deliver it to another SFTP endpoint.

csv to json flow

In this flow, the "Processor" outport of SFTP ingress connector is connected to the inport of the CSV to JSON Transformer so that the SFTP message received by the connector is handed over to the transformer next. If the processing element is able to transform the payload from CSV to JSON successfully, the message with the transformed payload is handed over to the SFTP egress connector, as the "Next" outport of the CSV to JSON Transformer is connected to it.

In the case of transformation failure, a log will be generated and then the message flow will complete in an exceptional state, as the "On Exception" outport of the CSV to JSON Transformer is connected to a Logger processing element, followed by an Exceptional Flow End element.

Out Ports

Next

The message will be sent to this outport if the payload transformation is completed successfully

On Exception

The message will be sent to this outport if the processing element failed to transform the payload due to some reason

Parameters

Allow single column *

Basic

Specifies whether to allow transforming single column CSV files. If this is set to true, the transformer will attempt to transform even the payloads that has been recognized to have only one CSV column. Otherwise the transformer will fail at such kind of payloads. The default value of this parameter is set to false.

Setting this parameter to true will make the transformer to attempt to convert non-CSV payloads as well. Therefore this value should not be set to true unless the user is really expecting single column CSV payloads.
In this topic
In this topic
Contact Us