Hi,
Thanks for helping…
For context, I’m sending an update to a Sales Order in an ERP (that is coming from an excel file) and the API expects all line updates to the SO to be in the Body of the API call. It’s not practical to update individual lines as there can be a lot of them and multiple updates will create unnecessary load and timing issues.
Below is a extract of the JSON data coming into the HTTP Request (variable record qty) from my Code Node that cleans up the data. Up till this point everything is working as expected:
[
{
"id": "b4a9f2ef-7862-ee11-ac3c-0a34284ced4a",
"InventoryID": {
"value": "BS6414GXAX"
},
"OrderQty": {
"value": 1
}
},
{
"id": "b5a9f2ef-7862-ee11-ac3c-0a34284ced4a",
"InventoryID": {
"value": "BS6414GXCX"
},
"OrderQty": {
"value": 2
}
},
{
"id": "b6a9f2ef-7862-ee11-ac3c-0a34284ced4a",
"InventoryID": {
"value": "BS6414GXEX"
},
"OrderQty": {
"value": 3
}
}
]
Basically I need the above data to look like the following JSON in my HTTP Request Body when I send it:
{
"Details": [
{
"id": "7e8f3eb0-0463-ee11-ac3c-0a34284ced4a",
"InventoryID": {
"value": "BS6414GXAX"
},
"OrderQty": {
"value": 1
}
},
{
"id": "7f8f3eb0-0463-ee11-ac3c-0a34284ced4a",
"InventoryID": {
"value": "BS6414GXCX"
},
"OrderQty": {
"value": 2
}
},
{
"id": "808f3eb0-0463-ee11-ac3c-0a34284ced4a",
"InventoryID": {
"value": "BS6414GXEX"
},
"OrderQty": {
"value": 3
}
}
]
}
With this Expression in the Body of the HTTP request I get the first record (which makes sense):
{
"Details": [
{
"id": "{{ $json["id"] }}",
"InventoryID": {
"value": "{{ $json["InventoryID"]["value"] }}"
},
"OrderQty": {
"value": {{ $json["OrderQty"]["value"] }}
}
}
]
}
But with execute once on I only get the first line updated…
Is this possible? Obviously I can only Execute the HTTP Request once, so my question is what does the Body Expression look like to loop through the data coming in from the Code node or do I need to do something in the Code node that makes it send just a single record with the JSON I need and then use in the Body.
Sorry if this is a simple question but I’m no expert in either JSON, Javascript or API’s 
Thanks,
Jason