Guide · Reading time: 1 min
Reshape nested JSON for an import
Turn records in a nested JSON array into a new structure and check the result before importing.
Tierify ·
Select the records to map
Open the Bulk JSON Mapper and load its example. The sample has a batch label and two customers under data.users. Set the records path to data.users and map each array item individually. You should get two records, in the same order as the input.
Check the new keys and arrays
Map profile.name to customer.name, orders[*].sku to orderSkus, and $$.batch to batch. In the output, Ada has two SKUs and Lin has one. Lin’s orderSkus is still an array. Both records keep the north batch label. If the importer expects each SKU to stay with its quantity and price, use the advanced example, which builds an object for each order line.
Try one file before running the batch
A missing source key can become null, be omitted, or stop the run. Try the setting your importer expects with a record that lacks the field, then check a record where the field is explicitly null. Keep identifiers such as 001 as JSON strings if those zeros matter.
Export the mapping after checking the preview. Apply it to the remaining files and compare the record count in each download with its source. The default creates one output per input file, so you can trace a bad record to its original file.
Examples
Bulk JSON Mapper
Input text
{
"batch": "north",
"data": {
"users": [
{
"id": "u1",
"profile": {
"name": "Ada",
"email": "ada@example.com"
},
"orders": [
{
"sku": "A1",
"qty": 2,
"price": 12
},
{
"sku": "B2",
"qty": 1,
"price": 8
}
]
},
{
"id": "u2",
"profile": {
"name": "Lin",
"email": "lin@example.com"
},
"orders": [
{
"sku": "C3",
"qty": 3,
"price": 5
}
]
}
]
}
}Converted text
[
{
"id": "u1",
"customer": {
"name": "Ada",
"email": "ada@example.com"
},
"orderSkus": [
"A1",
"B2"
],
"batch": "north"
},
{
"id": "u2",
"customer": {
"name": "Lin",
"email": "lin@example.com"
},
"orderSkus": [
"C3"
],
"batch": "north"
}
]Download example result