Dealing with collections and arrays

Hello,

I am trying to take all the values for “Name” of each collection in this context.

I have tried a bunch of things and also looked for similar questions asked in the community but it did not help me much.

I want to create a text that contains all the names comma-separated.
ex: Name1, Name2, Name3 …

I have not used the iteration module of make.com because I want to consume fewer operations.

Relevant part of the data is the following:

 "cac:InvoiceLine": [
                {
                    "cbc:ID": [
                        1
                    ],
                    "cbc:InvoicedQuantity": [
                        {
                            "_value": 1,
                            "_attributes": {
                                "unitCode": "C62"
                            }
                        }
                    ],
                    "cbc:LineExtensionAmount": [
                        {
                            "_value": 25,
                            "_attributes": {
                                "currencyID": "TRY"
                            }
                        }
                    ],
                    "cac:AllowanceCharge": [
                        {
                            "cbc:ChargeIndicator": [
                                false
                            ],
                            "cbc:MultiplierFactorNumeric": [
                                "0"
                            ],
                            "cbc:Amount": [
                                {
                                    "_value": "0.00",
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ],
                    "cac:TaxTotal": [
                        {
                            "cbc:TaxAmount": [
                                {
                                    "_value": 5,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ],
                            "cac:TaxSubtotal": [
                                {
                                    "cbc:TaxableAmount": [
                                        {
                                            "_value": 25,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:TaxAmount": [
                                        {
                                            "_value": 5,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:Percent": [
                                        20
                                    ],
                                    "cac:TaxCategory": [
                                        {
                                            "cac:TaxScheme": [
                                                {
                                                    "cbc:Name": [
                                                        "KDV"
                                                    ],
                                                    "cbc:TaxTypeCode": [
                                                        "0015"
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Item": [
                        {
                            "cbc:Name": [
                                "Çapak Gözlüğü"
                            ],
                            "cac:SellersItemIdentification": [
                                {
                                    "cbc:ID": [
                                        "URN000169"
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Price": [
                        {
                            "cbc:PriceAmount": [
                                {
                                    "_value": 25,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ]
                },
                {
                    "cbc:ID": [
                        2
                    ],
                    "cbc:InvoicedQuantity": [
                        {
                            "_value": 25,
                            "_attributes": {
                                "unitCode": "C62"
                            }
                        }
                    ],
                    "cbc:LineExtensionAmount": [
                        {
                            "_value": 14000,
                            "_attributes": {
                                "currencyID": "TRY"
                            }
                        }
                    ],
                    "cac:AllowanceCharge": [
                        {
                            "cbc:ChargeIndicator": [
                                false
                            ],
                            "cbc:MultiplierFactorNumeric": [
                                "0"
                            ],
                            "cbc:Amount": [
                                {
                                    "_value": "0.00",
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ],
                    "cac:TaxTotal": [
                        {
                            "cbc:TaxAmount": [
                                {
                                    "_value": 2800,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ],
                            "cac:TaxSubtotal": [
                                {
                                    "cbc:TaxableAmount": [
                                        {
                                            "_value": 14000,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:TaxAmount": [
                                        {
                                            "_value": 2800,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:Percent": [
                                        20
                                    ],
                                    "cac:TaxCategory": [
                                        {
                                            "cac:TaxScheme": [
                                                {
                                                    "cbc:Name": [
                                                        "KDV"
                                                    ],
                                                    "cbc:TaxTypeCode": [
                                                        "0015"
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Item": [
                        {
                            "cbc:Name": [
                                "Kalın Sıva Filesi"
                            ],
                            "cac:SellersItemIdentification": [
                                {
                                    "cbc:ID": [
                                        "URN000170"
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Price": [
                        {
                            "cbc:PriceAmount": [
                                {
                                    "_value": 560,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ]
                },
                {
                    "cbc:ID": [
                        3
                    ],
                    "cbc:InvoicedQuantity": [
                        {
                            "_value": 9,
                            "_attributes": {
                                "unitCode": "C62"
                            }
                        }
                    ],
                    "cbc:LineExtensionAmount": [
                        {
                            "_value": 11700,
                            "_attributes": {
                                "currencyID": "TRY"
                            }
                        }
                    ],
                    "cac:AllowanceCharge": [
                        {
                            "cbc:ChargeIndicator": [
                                false
                            ],
                            "cbc:MultiplierFactorNumeric": [
                                "0"
                            ],
                            "cbc:Amount": [
                                {
                                    "_value": "0.00",
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ],
                    "cac:TaxTotal": [
                        {
                            "cbc:TaxAmount": [
                                {
                                    "_value": 2340,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ],
                            "cac:TaxSubtotal": [
                                {
                                    "cbc:TaxableAmount": [
                                        {
                                            "_value": 11700,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:TaxAmount": [
                                        {
                                            "_value": 2340,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:Percent": [
                                        20
                                    ],
                                    "cac:TaxCategory": [
                                        {
                                            "cac:TaxScheme": [
                                                {
                                                    "cbc:Name": [
                                                        "KDV"
                                                    ],
                                                    "cbc:TaxTypeCode": [
                                                        "0015"
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Item": [
                        {
                            "cbc:Name": [
                                "20 Kg Fit Özel Mat Marshall"
                            ],
                            "cac:SellersItemIdentification": [
                                {
                                    "cbc:ID": [
                                        "URN000171"
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Price": [
                        {
                            "cbc:PriceAmount": [
                                {
                                    "_value": 1300,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ]
                },
                {
                    "cbc:ID": [
                        4
                    ],
                    "cbc:InvoicedQuantity": [
                        {
                            "_value": 1,
                            "_attributes": {
                                "unitCode": "C62"
                            }
                        }
                    ],
                    "cbc:LineExtensionAmount": [
                        {
                            "_value": 790,
                            "_attributes": {
                                "currencyID": "TRY"
                            }
                        }
                    ],
                    "cac:AllowanceCharge": [
                        {
                            "cbc:ChargeIndicator": [
                                false
                            ],
                            "cbc:MultiplierFactorNumeric": [
                                "0"
                            ],
                            "cbc:Amount": [
                                {
                                    "_value": "0.00",
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ],
                    "cac:TaxTotal": [
                        {
                            "cbc:TaxAmount": [
                                {
                                    "_value": 158,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ],
                            "cac:TaxSubtotal": [
                                {
                                    "cbc:TaxableAmount": [
                                        {
                                            "_value": 790,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:TaxAmount": [
                                        {
                                            "_value": 158,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:Percent": [
                                        20
                                    ],
                                    "cac:TaxCategory": [
                                        {
                                            "cac:TaxScheme": [
                                                {
                                                    "cbc:Name": [
                                                        "KDV"
                                                    ],
                                                    "cbc:TaxTypeCode": [
                                                        "0015"
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Item": [
                        {
                            "cbc:Name": [
                                "10 Kg Marshall Sil. Özel Mat"
                            ],
                            "cac:SellersItemIdentification": [
                                {
                                    "cbc:ID": [
                                        "URN000172"
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Price": [
                        {
                            "cbc:PriceAmount": [
                                {
                                    "_value": 790,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ]
                },
                {
                    "cbc:ID": [
                        5
                    ],
                    "cbc:InvoicedQuantity": [
                        {
                            "_value": 3,
                            "_attributes": {
                                "unitCode": "C62"
                            }
                        }
                    ],
                    "cbc:LineExtensionAmount": [
                        {
                            "_value": 1350,
                            "_attributes": {
                                "currencyID": "TRY"
                            }
                        }
                    ],
                    "cac:AllowanceCharge": [
                        {
                            "cbc:ChargeIndicator": [
                                false
                            ],
                            "cbc:MultiplierFactorNumeric": [
                                "0"
                            ],
                            "cbc:Amount": [
                                {
                                    "_value": "0.00",
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ],
                    "cac:TaxTotal": [
                        {
                            "cbc:TaxAmount": [
                                {
                                    "_value": 270,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ],
                            "cac:TaxSubtotal": [
                                {
                                    "cbc:TaxableAmount": [
                                        {
                                            "_value": 1350,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:TaxAmount": [
                                        {
                                            "_value": 270,
                                            "_attributes": {
                                                "currencyID": "TRY"
                                            }
                                        }
                                    ],
                                    "cbc:Percent": [
                                        20
                                    ],
                                    "cac:TaxCategory": [
                                        {
                                            "cac:TaxScheme": [
                                                {
                                                    "cbc:Name": [
                                                        "KDV"
                                                    ],
                                                    "cbc:TaxTypeCode": [
                                                        "0015"
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Item": [
                        {
                            "cbc:Name": [
                                "20 Kg Marshall Tavan Boyası"
                            ],
                            "cac:SellersItemIdentification": [
                                {
                                    "cbc:ID": [
                                        "URN000173"
                                    ]
                                }
                            ]
                        }
                    ],
                    "cac:Price": [
                        {
                            "cbc:PriceAmount": [
                                {
                                    "_value": 450,
                                    "_attributes": {
                                        "currencyID": "TRY"
                                    }
                                }
                            ]
                        }
                    ]
                },
                

Thanks in advance!

Hey @igonulkirmaz

Welcome to the Make Community🎉

I have tried to use the JSON you attached but it appears to be incorrect. Can you export it again by using the ‘Export Output Bundles’ button from the concerned module:

image

Ensure to copy the JSON fully.

1 Like

Are you familiar with the map() variable?

My brain is too tired to think as I’m about to head to bed, but

You’d need to use the map () function twice I believe, first do it the easy way.

Map cacInvoiceLine to return array of cacItem.

Then use map function from that returned array to return all cbc:Name as an array.

Then you can use join() function or iterator+text aggregator to get the string

1 Like