Problem
In CSV, each row is an order item. We need to get one JSON order object with an array of positions.
Short answer
Use a JSON editor: select the desired node, set transformations and upload the result to the target structure.
Sample task
The data below is educational. They show the conversion form, not the users' actual files.
It was
order,customer,sku,qty
O-001,Customer 1,SKU-1,2
O-001,Customer 1,SKU-2,1
O-002,Customer 2,SKU-3,4
It became
[
{
"order": "O-001",
"customer": "Customer 1",
"items": [
{ "sku": "SKU-1", "qty": 2 },
{ "sku": "SKU-2", "qty": 1 }
]
},
{
"order": "O-002",
"customer": "Customer 2",
"items": [
{ "sku": "SKU-3", "qty": 4 }
]
}
]
How to set up
- Upload CSV or XLSX as a table source.
- Open the table editor and check that the column headings are recognized correctly.
- In the settings of the desired column, open the block "Transformations".
- If the entire line must be excluded, set the rule in a block "Unloading conditions".
- Save the settings and download the result in the desired format.