Transform (CSV to JSON) block

The convert_csv_to_json block transforms CSV files into JSON format with optional sorting and grouping. It acts as a transformation block in a Connect+ dataflow, sitting between the source and destination blocks to convert ingested CSV data into structured JSON. The block supports header-based sorting, alphabetical ordering, record grouping by a specified field, and configurable grouping limits to manage payload size for downstream processing.

When to use this block

Use this block when your dataflow ingests CSV files and needs to convert them to JSON before posting to a Capillary API or another destination.

Prerequisites

Before configuring this block, make sure you have:

  • A clear understanding of the CSV column headers and the desired output structure
  • Identified whether records need to be grouped and by which field

Standard properties

Field nameRequiredDescription
Block nameNoA name for the block instance. The name must be alphanumeric. There is no character limit.
File Type (Record Reader Controller Service)YesThe record reader controller service used to parse the source file. Default value: csv.
Sort HeadersNoA comma-separated list of header names that defines the order in which rows are sorted.
For example, bill ID,itemID.
Alphabetical sort?NoWhen set to true, sorts headers alphabetically.
Select true to enable or false to disable.
Default value: false.
Grouping LimitNoThe maximum number of records per group. Accepts values between 1 and 1000.
Default value: 1.
Group ByNoA comma-separated list of fields to group records by.
For example, bill ID.
JsonPath Expression
Json expression
NoA JSONPath expression that specifies which elements to extract from the JSON structure.
The default value $.[*] selects all elements in the root array.
Use this when you want to split the response.
Split ResponseNoDetermines whether the block splits the JSON array into individual objects before passing them to the next block.
Select true to send each element as a separate message. Select false to pass the entire array as a single message.

Advanced properties

⚠️ Make changes to advanced properties only if you know what you are doing.

Field nameRequiredDescription
attribution typeNoThe type of attribution to apply to the records. For example, TILL.
attribution codeNoThe code associated with the attribution type. For example, store_till_001.
header value to passNoThe header value to pass along with the request.
child org tillNoThe till identifier for the child organisation.
child org IdNoThe ID of the child organisation.
lineNo parsingNoThe expression used to parse the line number from the source record.
Default value: $[0].LINE_NO.
JsonPath ExpressionNoThe JSONPath expression used to extract records from the JSON output. Default value: $.[*].
Split ResponseNoSplits the output when the block produces an array of objects. Select true to split each array element into individual responses, or false to keep the response as a single array. Default value: false.