In Make.com / Integromat, I have an API call result with the following format (I have actually much more bundles, but that is not relevant for my question):
> Bundle 1 : {
"InvoiceId" : 1111,
"InvoiceElements" : [
{ "Id":1, "Description" : "Fish" , "Price" : 10},
{ "Id":2,"Description" : "Meat" , "Price" : 30},
{ "Id":3,"Description" : "Tomato" , "Price" : 4}
]
}
> Bundle 2 : {
"InvoiceId" : 1112,
"InvoiceElements" : [
{ "Id":1, "Description" : "Fish" , "Price" : 10},
{ "Id":2,"Description" : "Meat" , "Price" : 30},
]
And I cannot manage to transform this 2 Bundle-object into a 5-row array, or even a 5-Bundle output , without generating 2 operations (or N operations if I have N invoices/bundles !)
I simply would like t obtain a result like this :
[
{ "InvoiceId" : 1111, "Id":1, "Description" : "Fish" , "Price" : 10, "InvoiceId" : 1111},
{ "InvoiceId" : 1111, "Id":2, "Description" : "Meat" , "Price" : 30, "InvoiceId" : 1111},
{ "InvoiceId" : 1111, "Id":3, "Description" : "Tomato" , "Price" : 4, "InvoiceId" : 1111},
{ "InvoiceId" : 1112, "Id":1, "Description" : "Fish" , "Price" : 10, "InvoiceId" : 1112},
{ "InvoiceId" : 1113, "Id":2, "Description" : "Meat" , "Price" : 30, "InvoiceId" : 1112},
]
Is there a way to get this object format with a fixed number of operations ?
Due to the nested array, processing your data in make will require more than n operations for n bundles. There are two workarounds to this problem: