Describe the problem/error/question
Hello, I have a json with an array inside it.
If I use Rename Key for a field that is not in the array, I can rename it.
If I try to use Rename Key for a field within an array of this Json, I can’t rename it.
This array may have several items, so I would have to rename them all.
What is the error message (if any)?
Please share your workflow
Example Json:
{ “CODPARC”: 0,
“CODBAIRRO”: 0,
“CODEND”: 1,
“CODCID”: 0,
“_orderitem_of_order”: [
{
“id”: 1,
“created_at”: 1690489203530,
“product_id”: 225596508,
“product_title”: “Cesta Oval Com Alça Em Papel Com Forro Em Tecido 27X20X12Cm”,
“sku_id”: 82801051,
“sku_title”: “Cesta Oval Com Alça Em Papel Com Forro Em Tecido 27X20X12Cm”,
“sku_partnerid”: “ROJE61516”,
“sku_ean”: “7895730615166”,
“order_id”: 1,
“idanymarket”: 127340785,
“amout”: 1,
“unit”: 21.9,
“gross”: 21.9,
“total”: 21.9
},
{
“id”: 2,
“created_at”: 1690489203530,
“product_id”: 225596321,
“product_title”: “Cesta Forro Em Tecido 27X20X12Cm”,
“sku_id”: 82801051,
“sku_title”: “Cesta Forro Em Tecido 27X20X12Cm”,
“sku_partnerid”: “ROJE61592”,
“sku_ean”: “7895730615189”,
“order_id”: 1,
“idanymarket”: 1273407802,
“amout”: 2,
“unit”: 22.9, //**** RENAME KEY TO: VLRUNIT
“gross”: 22.9,
“total”: 22.9
}
]
}
]
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: