Help extracting custom fields from webhook meta_data in Make (Array Aggregator + Set Multiple Variables)

Hi everyone,

I’m learning Make and trying to get better at building cleaner automations. Right now I’m working on an integration where the webhook includes several custom fields (Codice Fiscale, Partita IVA, PEC/SDI, Occupazione, etc.).

Since those fields don’t show up as standard fields, they all come merged inside meta_data.

Here’s what I have working now:

  • I use an Iterator to split the meta_data into bundles.

  • Right after the iterator I filter only the values I care about.

  • Then I run a Router with multiple filters (e.g., only _billing_codice_fiscale passes one branch).

  • On each branch, I use Set Variable to store the value and then pass it into ActiveCampaign.

This works, but it means I’m repeating the same structure for each custom field and instead of updating each contact once, I update it 5-6 times, once per field. It feels clunky and inefficient.

ChatGPT kept insisting on a different setup:

  • Use Iterator + Array Aggregator + Set Multiple Variables,

  • And inside Set Multiple Variables use formulas like this:

get( get( {{16.array}} ; indexOf( map( {{16.array}} ; “name” ) ; “_billing_codice_fiscale” ) ) ; “value” )

But that never worked: instead of returning the actual value, I would just get a long string of code as output.

In that version, the Iterator output looked fine, the Array Aggregator output looked fine, but the Set Multiple Variables messed everything up.

So my questions are:

  1. Is it possible to extract multiple custom fields from webhook meta_data into named variables using one Set Multiple Variables module?

  2. If yes, could someone show me a working example of the formula setup (instead of separate router branches)?

  3. Or is my current router + set variable approach actually the best practice here?

This isn’t a client project (my current solution already works), I just want to improve my skills and learn how to structure scenarios more efficiently without spending a fortune on consulting for something this small.

Thanks a lot!

Hi @Fangelo ,

thanks for the detailed description. Sadly, the output of the webhook is missing as a crucial part of this question.

I assume that the meta_data is an array containing multiple values.

In this example the webhook outputs an array of headers. You can use the map() formula to retrieve multiple values. The set multiple variables modules can be used but more often than not it’s not necessary! It might be helpful though to check the result of formulas :slight_smile:

You can read the map() formula like this:
go through each item of the array “Headers” and give me the value of each item. BUT only where the name is equal to “XYZ” (here cf-ray for example).

Mind you that the map() formula returns an array. If you want to get a single string/number, you might need to add a first() formula.
first(map(…))

I hope this helps!

Best,
Richard

Hi Richard,

thank you so much for your prompt reply!

I’ll be testing your approach right now.

Here is the output of the webhook.

The fields I am trying to map are:
_billing_codice_fiscale - ID 907
_billing_partita_iva - ID 910
_billing_occupazione - 911
billing_quando_vuoi_partecipare - ID 912
_billing_fatturazione_elettronica - ID 909
_billing_ragione_sociale - ID 908

Thank you again!

[
    {
        "id": 319,
        "parent_id": 0,
        "status": "refunded",
        "currency": "EUR",
        "version": "10.1.2",
        "prices_include_tax": false,
        "date_created": "2025-09-04T21:38:57",
        "date_modified": "2025-09-04T22:27:24",
        "discount_total": "48.00",
        "discount_tax": "0.00",
        "shipping_total": "0.00",
        "shipping_tax": "0.00",
        "cart_tax": "0.00",
        "total": "1.00",
        "total_tax": "0.00",
        "customer_id": 0,
        "order_key": "wc_order_SFNUolRCv0uXT",
        "billing": {
            "first_name": “x”,
            "last_name": “y”,
            "company": "",
            "address_1": "via nicolo , 13",
            "address_2": "",
            "city": "TORRE",
            "state": "BG",
            "postcode": "24032",
            "country": "IT",
            "email": “a@gmail.cx",
            "phone": "+393394444333
        },
        "shipping": {
            "first_name": "",
            "last_name": "",
            "company": "",
            "address_1": "",
            "address_2": "",
            "city": "",
            "state": "",
            "postcode": "",
            "country": "",
            "phone": ""
        },
        "payment_method": "stripe",
        "payment_method_title": "Carta di credito o debito",
        "transaction_id": "ch_3S3izn75cR2kCb4g1nqfsAcM",
        "customer_ip_address": "93.35.171.158",
        "customer_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36",
        "created_via": "checkout",
        "customer_note": "",
        "date_completed": "2025-09-04T21:39:07",
        "date_paid": "2025-09-04T21:39:07",
        "cart_hash": "6f2c85328f3546ae9c3235542c6fede8",
        "number": "319",
        "meta_data": [
            {
                "id": 935,
                "key": "_automatewoo_order_created",
                "value": "1"
            },
            {
                "id": 907,
                "key": "_billing_codice_fiscale",
                "value": "Codice Fiscale"
            },
            {
                "id": 909,
                "key": "_billing_fatturazione_elettronica",
                "value": "Pec"
            },
            {
                "id": 911,
                "key": "_billing_occupazione",
                "value": "Occupazione"
            },
            {
                "id": 910,
                "key": "_billing_partita_iva",
                "value": "Partita IVA"
            },
            {
                "id": 912,
                "key": "_billing_quando_vuoi_partecipare_",
                "value": "2025-09"
            },
            {
                "id": 908,
                "key": "_billing_ragione_sociale",
                "value": "Ragione sociale"
            },
            {
                "id": 931,
                "key": "_stripe_charge_captured",
                "value": "yes"
            },
            {
                "id": 934,
                "key": "_stripe_currency",
                "value": "EUR"
            },
            {
                "id": 928,
                "key": "_stripe_customer_id",
                "value": "cus_SziEaDk1wpPT7a"
            },
            {
                "id": 932,
                "key": "_stripe_fee",
                "value": "0.27"
            },
            {
                "id": 930,
                "key": "_stripe_intent_id",
                "value": "pi_3S3izn75cR2kCb4g1aUBuDz4"
            },
            {
                "id": 1160,
                "key": "_stripe_lock_refund",
                "value": "1757017944"
            },
            {
                "id": 933,
                "key": "_stripe_net",
                "value": "-0.27"
            },
            {
                "id": 1159,
                "key": "_stripe_refund_id",
                "value": "re_3S3izn75cR2kCb4g1ydWaNmH"
            },
            {
                "id": 927,
                "key": "_stripe_source_id",
                "value": "pm_1S3izl75cR2kCb4gzblXV65A"
            },
            {
                "id": 929,
                "key": "_stripe_upe_payment_type",
                "value": "card"
            },
            {
                "id": 925,
                "key": "_wc_order_attribution_device_type",
                "value": "Desktop"
            },
            {
                "id": 923,
                "key": "_wc_order_attribution_session_count",
                "value": "2"
            },
            {
                "id": 920,
                "key": "_wc_order_attribution_session_entry",
                "value": "https://cart.x.com/checkout/priority-and-plan/"
            },
            {
                "id": 922,
                "key": "_wc_order_attribution_session_pages",
                "value": "23"
            },
            {
                "id": 921,
                "key": "_wc_order_attribution_session_start_time",
                "value": "2025-09-04 15:24:25"
            },
            {
                "id": 918,
                "key": "_wc_order_attribution_source_type",
                "value": "typein"
            },
            {
                "id": 924,
                "key": "_wc_order_attribution_user_agent",
                "value": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36"
            },
            {
                "id": 919,
                "key": "_wc_order_attribution_utm_source",
                "value": "(direct)"
            },
            {
                "id": 917,
                "key": "_wcf_checkout_id",
                "value": "267"
            },
            {
                "id": 916,
                "key": "_wcf_flow_id",
                "value": "266"
            },
            {
                "id": 913,
                "key": "is_vat_exempt",
                "value": "no"
            }
        ],
        "line_items": [
            {
                "id": 100,
                "name": "P&P - Kickstart - 1 sessione - Per provare la sessione, iniziare a fare ordine e sbloccare il tuo mese",
                "product_id": 262,
                "variation_id": 263,
                "quantity": 1,
                "tax_class": "",
                "subtotal": "49.00",
                "subtotal_tax": "0.00",
                "total": "1.00",
                "total_tax": "0.00",
                "taxes": [],
                "meta_data": [
                    {
                        "id": 833,
                        "key": "pacchetto-di-lezioni",
                        "value": "Kickstart - 1 sessione - Per provare la sessione, iniziare a fare ordine e sbloccare il tuo mese",
                        "display_key": "Pacchetto di lezioni",
                        "display_value": "Kickstart - 1 sessione - Per provare la sessione, iniziare a fare ordine e sbloccare il tuo mese"
                    }
                ],
                "sku": "",
                "global_unique_id": "",
                "price": 1,
                "image": {
                    "id": 231,
                    "src": "https://cart.x.com/wp-content/uploads/2025/08/logo-lucia-pascali-1.webp"
                },
                "parent_name": "P&P"
            }
        ],
        "tax_lines": [],
        "shipping_lines": [],
        "fee_lines": [],
        "coupon_lines": [
            {
                "id": 101,
                "code": "f",
                "discount": "48",
                "discount_tax": "0",
                "meta_data": [
                    {
                        "id": 836,
                        "key": "coupon_info",
                        "value": "[291,\"f\",null,48]",
                        "display_key": "coupon_info",
                        "display_value": "[291,\"f\",null,48]"
                    }
                ],
                "discount_type": "fixed_cart",
                "nominal_amount": 48,
                "free_shipping": false
            }
        ],
        "refunds": [
            {
                "id": 343,
                "reason": "",
                "total": "-1.00"
            }
        ],
        "payment_url": "https://cart.x.com/checkout/order-pay/319/?pay_for_order=true&key=wc_order_SFNUolRCv0uXT",
        "is_editable": false,
        "needs_payment": false,
        "needs_processing": true,
        "date_created_gmt": "2025-09-04T19:38:57",
        "date_modified_gmt": "2025-09-04T20:27:24",
        "date_completed_gmt": "2025-09-04T19:39:07",
        "date_paid_gmt": "2025-09-04T19:39:07",
        "currency_symbol": "€",
        "_links": {
            "self": [
                {
                    "href": "https://cart.luciapascali.com/wp-json/wc/v3/orders/319",
                    "targetHints": {
                        "allow": [
                            "GET",
                            "POST",
                            "PUT",
                            "PATCH",
                            "DELETE"
                        ]
                    }
                }
            ],
            "collection": [
                {
                    "href": "https://cart.x.com/wp-json/wc/v3/orders"
                }
            ],
            "email_templates": [
                {
                    "embeddable": true,
                    "href": "https://cart.x.com/wp-json/wc/v3/orders/319/actions/email_templates"
                }
            ]
        }
    }
]

Awesome, thank you!

In this case it would be

first(map(1.body.meta_data;value;id;907))
first(map(1.body.meta_data;value;id;910))

or alternatively

first(map(1.body.meta_data;value;key;_billing_codice_fiscale))
first(map(1.body.meta_data;value;key;_billing_partita_iva))

Can you try to copy & paste it like this:
{{first(map(1.body.meta_data;value;id;907))}}