How to retrieve data from several collections nested in an array?

Hi everyone,

I receive some data to a custom webhook. The structure is the following

[
    {
        "lead_id": "TeSter-123-ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-0123456789-AaBbCcDdEeFfGgHhIiJjKkLl",
        "user_column_data": [
            {
                "column_name": "User Phone",
                "string_value": "+16505550123",
                "column_id": "PHONE_NUMBER"
            },
            {
                "column_name": "Postal Code",
                "string_value": "94043",
                "column_id": "POSTAL_CODE"
            },
            {
                "column_name": "User Email",
                "string_value": "test@example.com",
                "column_id": "EMAIL"
            },
            {
                "column_name": "First Name",
                "string_value": "PrĂŠnom",
                "column_id": "FIRST_NAME"
            },
            {
                "column_name": "Last Name",
                "string_value": "Nom",
                "column_id": "LAST_NAME"
            }
        ],
        "api_version": "1.0",
        "form_id": 174926342406,
        "campaign_id": 21754229026,
        "google_key": "installateur_pac",
        "is_test": true,
        "gcl_id": "TeSter-123-ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-0123456789-AaBbCcDdEeFfGgHhIiJjKkLl",
        "adgroup_id": 20000000000,
        "creative_id": 30000000000
    }
]

As you see, I have 5 collections nested in one array, itself nested in the Bundle 1 collection.

Nevertheless, I want to put the data from this webhook to my CRM. I tried to use several modules but I believe I am not using them correctly or not the right ones.

Indeed, the only data I manage to pull are the one from the user_column_data[5]
Capture d’écran 2024-10-01 à 14.50.09

I would appreciate any help on the matter.

Cheers

It may not be the best way, but this is what I use. If you wanted to get the value for User Phone, this is what you’d put in the CRM field:

get(map({{8.user_column_data}};string_value;column_id;PHONE_NUMBER);1)

Put that in the field in your CRM module. Then just modify it for each of the remaining items. What it tells Make is that you want it to create an array from the collections in the {{8.user_column_data}} array * the map() function* with the string_value of a column_id named PHONE_NUMBER. The * get() * function then gets the content of the map function which gives you the requested value.

It breaks down into get( map( “array my data is in” ; “what I want” ; “the name of a variable that is in the same array that I know” ; “the value of the variable that I know”) ; "give me the answer to ‘what I want’ ")

1 Like

Hey Quentin,

for better visualization purposes, Make only shows the latest bundle from the array.

The way you process all of them depends entirely on your flow - do you need to do it one at a time or filter them? Or bulk send them somewhere?

Thank you for your answer. I need to bulk send them together as at the end I create a record in my CRM and need to fill all the info.

Thank you. I tried to play with map() as well. I will try your solution tomorrow. Thanks in avance

Thank you Alyssa, it worked very well.