# Extracting Multiple Items From Nested Collections In An Array

**URL:** <https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302>\
**Category:** Questions\
**Tags:** arrays, functions, mapping\
**Created:** [November 9, 2023, 2:04am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302 "2023-11-09T02:04:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christofer\_Willis](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christofer\_Willis](https://community.make.com/u/Christofer_Willis)\
**Post date:** [November 9, 2023, 2:04am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302/1 "2023-11-09T02:04:12Z")

</div>

So I know this kind of question seems to get asked a lot around here, but in my specific case I can’t seem to find the exact answer I’m looking for.

What I’m trying to do is get a mappable output each of these “Long Name” Address Components from each collection of the “Address Components” array so I can populate address line fields on an invoice.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/d/c/dc832aa86e0ff3c388712b4c0b991af2cd4fb151.png)

I know that achieving this likely uses some combination of an` iterator`,` aggregator`, and/or a `JSON Parser`, but I for the life of me can’t figure out the right combination. I can’t seem to wrap my head around the `map` function in combination with the aforementioned modules to get each value to have a unique mappable value.

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Christofer\_Willis](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christofer\_Willis](https://community.make.com/u/Christofer_Willis)\
**Post date:** [November 9, 2023, 2:06am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302/2 "2023-11-09T02:06:54Z")

</div>

For some added context, what I want to achieve is to be able to send each of these values into a Quickbooks “Create An Invoice” module to populate each of these different fields.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/c/5/c524afc0cd44003c26769eeb7132acdb9b95bfc7.png)

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [November 9, 2023, 2:18am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302/3 "2023-11-09T02:18:54Z")

</div>

Welcome to the Make community!

Please provide the output bundles of the modules [6] by running the scenario, then click the white speech bubble on the top-right of each module, save the contents as a text `.json` file, and upload it here into this discussion thread:  
 ![Screenshot_2023-10-06_141025](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/8/2876156ab3ea5bc9e40bbc0edfb9f025406b7c48.png)

Providing the output bundles will allow others to _replicate_ what is going on in the scenario even if they do not use the external service (Google Maps).

This will allow others to better assist you. Thanks!

---

<div class="post-metadata">

**Author:** ![Christofer\_Willis](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christofer\_Willis](https://community.make.com/u/Christofer_Willis)\
**Post date:** [November 9, 2023, 2:21am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302/4 "2023-11-09T02:21:19Z")

</div>

Absolutely! Here you go

```auto
[
    {
        "address_components": [
            {
                "long_name": "69",
                "short_name": "69",
                "types": [
                    "street_number"
                ]
            },
            {
                "long_name": "Murray Avenue",
                "short_name": "Murray Ave",
                "types": [
                    "route"
                ]
            },
            {
                "long_name": "Larchmont",
                "short_name": "Larchmont",
                "types": [
                    "locality",
                    "political"
                ]
            },
            {
                "long_name": "Mamaroneck",
                "short_name": "Mamaroneck",
                "types": [
                    "administrative_area_level_3",
                    "political"
                ]
            },
            {
                "long_name": "Westchester County",
                "short_name": "Westchester County",
                "types": [
                    "administrative_area_level_2",
                    "political"
                ]
            },
            {
                "long_name": "New York",
                "short_name": "NY",
                "types": [
                    "administrative_area_level_1",
                    "political"
                ]
            },
            {
                "long_name": "United States",
                "short_name": "US",
                "types": [
                    "country",
                    "political"
                ]
            },
            {
                "long_name": "10538",
                "short_name": "10538",
                "types": [
                    "postal_code"
                ]
            },
            {
                "long_name": "2213",
                "short_name": "2213",
                "types": [
                    "postal_code_suffix"
                ]
            }
        ],
        "formatted_address": "69 Murray Ave, Larchmont, NY 10538, USA",
        "geometry": {
            "bounds": {
                "northeast": {
                    "lat": 40.9363233,
                    "lng": -73.76141129999999
                },
                "southwest": {
                    "lat": 40.93618410000001,
                    "lng": -73.76169639999999
                }
            },
            "location": {
                "lat": 40.9362461,
                "lng": -73.7616216
            },
            "location_type": "ROOFTOP",
            "viewport": {
                "northeast": {
                    "lat": 40.9376026802915,
                    "lng": -73.76020486970849
                },
                "southwest": {
                    "lat": 40.93490471970851,
                    "lng": -73.7629028302915
                }
            }
        },
        "place_id": "ChIJtbigOxeSwokR_zhKVtGi0Bg",
        "types": [
            "premise"
        ],
        "urlMap": "https://maps.google.com/?q=40.9362461,-73.7616216"
    }
]

```

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [November 9, 2023, 2:26am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302/5 "2023-11-09T02:26:07Z")

</div>

Use the `toCollection` built-in function:

 ![Screenshot_2023-11-09_101118](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/4/543419094da7f561e8a03249018df95384b7e9d3.png)

Output:

 ![Screenshot_2023-11-09_101128](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/f/d/fd469401e19e3e6da9663fd702bf0ee119813e7d.png)

---

<div class="post-metadata">

**Author:** ![Christofer\_Willis](https://avatars.discourse-cdn.com/v4/letter/c/919ad9/32.png) [@Christofer\_Willis](https://community.make.com/u/Christofer_Willis)\
**Post date:** [November 9, 2023, 2:28am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302/6 "2023-11-09T02:28:58Z")

</div>

You are a literal life saver.

**THANK YOU SO MUCH 😊**

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [November 9, 2023, 2:29am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302/7 "2023-11-09T02:29:18Z")

</div>

No problem, glad I could help!

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [November 23, 2023, 3:07am UTC](https://community.make.com/t/extracting-multiple-items-from-nested-collections-in-an-array/19302/8 "2023-11-23T03:07:16Z")

</div>


