# Nested complex JSON to CSV

**URL:** <https://community.make.com/t/nested-complex-json-to-csv/57235>\
**Category:** Questions\
**Tags:** arrays, filters, functions, mapping\
**Created:** [October 7, 2024, 2:41pm UTC](https://community.make.com/t/nested-complex-json-to-csv/57235 "2024-10-07T14:41:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parametrizacao\_Minds](https://avatars.discourse-cdn.com/v4/letter/p/f0a364/32.png) [@Parametrizacao\_Minds](https://community.make.com/u/Parametrizacao_Minds)\
**Post date:** [October 7, 2024, 2:41pm UTC](https://community.make.com/t/nested-complex-json-to-csv/57235/1 "2024-10-07T14:41:50Z")

</div>

Hi, this is my first post here in Make Community. Could you guys help me with something?

I am trying to convert a JSON file, coming from an API call, in a CSV file. I am unable to process the complex fields, which are JSON lists.

```json
{
    "results": [
        {
            "goal_name": "Goal Test Homer and Marge",
            "responsible": [
                {
                    "key": "homer@email.com",
                    "user": {
                        "id": 123,
                        "first_name": "Homer",
                        "last_name": "Simpson",
                        "username": "homer@email.com",
                        "email": "homer@email.com"
                    },
                    "weight": "1.0000"
                },
                {
                    "key": "marge@email.com",
                    "user": {
                        "id": 456,
                        "first_name": "Marge",
                        "last_name": "Simpson",
                        "username": "marge@email.com",
                        "email": "marge@email.com"
                    },
                    "weight": "1.0000"
                }
            ]
        },
        {
            "goal_name": "Goal Test Bart and Lisa",
            "responsible": [
                {
                    "key": "bart@email.com",
                    "user": {
                        "id": 321,
                        "first_name": "Bart",
                        "last_name": "Simpson",
                        "username": "bart@email.com",
                        "email": "bart@email.com"
                    },
                    "weight": "1.0000"
                },
                {
                    "key": "lisa@email.com",
                    "user": {
                        "id": 654,
                        "first_name": "Lisa",
                        "last_name": "Simpson",
                        "username": "lisa@email.com",
                        "email": "lisa@email.com"
                    },
                    "weight": "1.0000"
                }
            ]
        }
    ]
}

```

I have in my CSV 2 columns. One is the goal name (that I have already managed to solve) and the other, called responsible, I need write all first and last names of the objects in list, separeted by comma. In this example I gave, it would be:

| goal\_name | responsible |
| --- | --- |
| Goal Test Homer and Marge | Homer Simpson, Marge Simpson |
| Goal Test Bart and Lisa | Bart Simpson, Lisa Simpson |

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/8/7817c3cac6ad55774a1f2ae5af6dcd9d253e3f08.png)

This is my scenario. Please, someone to help me?

---

<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:** [October 8, 2024, 1:14am UTC](https://community.make.com/t/nested-complex-json-to-csv/57235/2 "2024-10-08T01:14:37Z")

</div>

Welcome to the Make community!

When you see **ARRAY** , think **ITERATOR**.

`responsible` is an **array** , so you need to use another **Iterator**.

 ![Screenshot_2024-10-08_091004](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/8/58396188345d99b7cef641dba5e8881b282b794d.png)

You might need to use another aggregator to join the first and last names.

 ![Screenshot_2024-10-08_091041](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/0/3/03a6de6b01a9577f22a15ef62a2502d6f7639b43.png)

Hope this helps! Let me know if there are any further questions or issues.

— @samliew

P.S.: Investing some effort into the [Make Academy](https://academy.make.com) will save you lots of time and frustration using Make.

---

<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:** [January 6, 2025, 2:25am UTC](https://community.make.com/t/nested-complex-json-to-csv/57235/3 "2025-01-06T02:25:26Z")

</div>


