Help: Extract “Leads” from Facebook Ads Get Insightsי

Goal: pull Leads from Get Insightsactions and write to Google Sheets (daily/weekly automation).

Tried:

  • {{ map(X.actions; value; action_type; "lead") }}

  • {{ sum(map(X.actions; number(value); action_type; "lead,onsite_conversion.lead_grouped")) }}

  • With and without Array aggregator, tried value__sum and get("value [sum]").

Issues:

  • Constant DataError ({empty} or invalid key), even when actions clearly contains multiple lead-related entries.

  • When I do manage to isolate lead, it behaves as if the value doesn’t exist on its own — like the match only exists in a broader structure and can’t truly be extracted.

  • Also saw “message too short” errors in Log (just UI, not logic-related).

Ask:

  • A working example to reliably extract lead value from actions, without breaking other metrics.

  • Best pattern for handling edge cases (missing actions, JSON string, etc.).

  • Is it better to just use Facebook Lead Ads → Watch Leads instead of Get Insights for this?

Any help from someone experienced would be appreciated :folded_hands: