The Definitive Guide to Parsing Complex JSON in Make.com
In the world of automation, JSON (JavaScript Object Notation) is the universal language. It is how your CRM talks to your email marketing tool. It is how your payment gateway validates transactions. It is how your custom app retrieves user data.
However, as APIs become more sophisticated, simple JSON is becoming rare. You are likely reading this because a scenario in Make.com has failed. You might be dealing with a webhook response containing nested arrays. Perhaps you have dynamic keys that change with every execution.
You are not alone. Parsing complex data is a major bottleneck for automation engineers. It is the difference between a brittle scenario and a robust ecosystem.
At Thinkpeak.ai, we specialize in transforming these manual frustrations into automated successes. We handle code-level complexity so you do not have to. For those ready to build, this is your guide to mastering complex JSON parsing.
1. The Anatomy of a JSON Headache: Collections vs. Arrays
Before you start dragging modules, you must understand how Make.com visualizes data. The user interface tries to simplify JSON. Unfortunately, this oversimplification is often the source of confusion.
The “Bundle” Trap
In Make.com, data moves in Bundles. A common misconception is that a Bundle is an Array. It is not. A Bundle is a discrete unit of work, or a single transaction.
- Collection: This is represented by a generic box icon. It is a single object with key-value pairs (e.g.,
{ "name": "John", "id": 123 }). You can map these fields directly. - Array: This is represented by square brackets
[]. It is a list of items. Make.com cannot map directly from an array to a single field because it does not know which item you want.
The Golden Rule: If you see an array ([]) in your output, you generally have two choices. You must either Iterate (process them one by one) or Map (extract specific data without splitting the flow).
2. The Standard Workflow: Parse, Iterate, Aggregate
This is the classic “ETL” (Extract, Transform, Load) pattern within Make. This method is reliable but operation-heavy. It is best used when you need to perform a unique action for every single item in a list.
Step 1: The Parse JSON Module
Most triggers attempt to auto-parse JSON. However, raw strings or complex payloads often require the native Parse JSON module.
Pro Tip: Never rely on “Auto-detect” for mission-critical workflows. Always manually define your data structure using the Generator. Paste a sample payload into the generator to create a rigid schema. This ensures Make knows a field should exist, even if it is null in a future execution.
Step 2: The Iterator
The Iterator is a powerful tool. It takes an Array and converts it into multiple Bundles.
- Input: One Bundle containing an Array of 10 items.
- Output: 10 separate Bundles.
Warning: Once you pass an Iterator, your scenario execution count multiplies. If you have 100 items, the modules following the Iterator run 100 times. This consumes operations rapidly.
Step 3: The Aggregator
After processing your items, you usually need to bring them back together. You might need to save them to a database or send a summary report. This requires the Array Aggregator.
- Source Module: Select the Iterator you started with. This tells Make when to stop grouping.
- Target Structure: Select your destination module here. This allows you to map fields directly into the destination format.
Are you building this workflow just to upload data to a spreadsheet? You might be over-engineering. Thinkpeak.ai offers solutions designed to handle thousands of rows of cleaning and formatting in seconds.
3. Advanced Technique: The map() Function
Efficiency is vital. Iterating through an array just to extract one piece of data is wasteful. Enter the map() function. This tool acts as a scalpel for JSON parsing.
The `map()` function allows you to extract an array of values from a complex array of objects. It does this without using an Iterator. This happens inside a single module, costing you zero extra operations.
The Syntax
map(array; value_to_return; key_to_filter; filter_value)
Scenario: Extracting an Email from a CRM Array
Imagine your JSON looks like this:
"contacts": [
{ "type": "work", "email": "work@example.com" },
{ "type": "personal", "email": "home@example.com" }
]
You only want the work email. If you simply map contacts[].email, Make returns both emails. You cannot rely on the order.
The Solution:
get(map(contacts; "email"; "type"; "work"); 1)
Breakdown:
- map(…): Look inside the
contactsarray. Find items wheretypeequalswork. Return only theemailfield. - get(…; 1): The result of `map` is still an array. `get` extracts the first item from that result.
Nested Arrays and Raw References
Deeply nested JSON often hides keys from the visual mapping panel. If you need to map a value inside a sub-array, you must type the raw parameter key.
Hover over the item in the output bundle to see its raw name (e.g., items[].price). You can manually type this into the `map()` function:
map(orders; "items[].price"; "status"; "active")
4. The Nightmare: Dynamic Keys and Variable Schemas
The most difficult JSON challenge involves Dynamic Keys. This occurs when the key itself is a variable.
Example of Challenging JSON:
"sales_data": {
"2026-01-01": { "revenue": 100 },
"2026-01-02": { "revenue": 200 }
}
Tomorrow, the keys will change to current dates. You cannot map this because the key name changes daily. Make.com expects static keys like “date” or “id”.
Solution 1: The toArray() Trick
Make provides a function called toArray(). This converts a Collection into an Array of Key-Value pairs.
Transformation: applying toArray(sales_data) converts the structure to:
[
{ "key": "2026-01-01", "value": { "revenue": 100 } },
{ "key": "2026-01-02", "value": { "revenue": 200 } }
]
Now, you have a static structure. You can iterate over this array. Map key as the date and value.revenue as the amount.
Solution 2: Regular Expressions (Regex)
If `toArray()` fails due to extreme nesting, use the Text Parser module. This treats the JSON as a raw string.
Pattern: "(d{4}-d{2}-d{2})":s*{s*"revenue":s*(d+)
This pattern captures the date and the revenue regardless of where they sit in the payload. If you are constantly building “band-aid” parsers, your infrastructure is at risk. Thinkpeak.ai can build custom middleware to normalize data before it hits your scenario.
5. AI-First Parsing: The Modern Standard
Why write complex Regex when an AI can do it for you? We advocate for “Agentic Automation.” Instead of hard-coding logic, we use LLMs to clean JSON.
The “Cleaner” Agent
If you receive unstructured text or messy JSON, pass the raw string to an AI module first. This is crucial for inputs with missing commas or trailing brackets.
Sample Prompt:
“You are a strict JSON formatter. Analyze the following input text. Extract the user contact details and return them as valid, flat JSON with keys: ‘name’, ’email’, ‘phone’. Do not add markdown formatting.”
This method converts garbage input into pristine JSON. This logic powers our AI Agent solutions, which sanitize messy form submissions to ensure data integrity.
6. Real-World Use Case: Parsing Meta Ads Insights
Marketing data is notoriously nested. A standard Meta Ads response contains layers of accounts, campaigns, insights, and actions.
The Goal: Extract the “Cost Per Purchase” for a specific ad creative.
- HTTP Request: Get the data.
- Map Function: The “actions” array contains generic event types. Use the map function to isolate the purchase event.
map(insight.actions; "value"; "action_type"; "offsite_conversion.fb_pixel_purchase") - Calculation: Divide the total spend by the result of the map function.
Manually building these pipelines is tedious. Automation can review daily spend and identify creative fatigue without you needing to touch a JSON parser.
7. Troubleshooting: Common JSON Errors
“Unexpected Token”
This error usually means your JSON string contains invalid characters. Often, this is an unescaped quote within a text string. Use the replace() function to sanitize the input string before parsing.
“Missing Bundle”
You might iterate through an array but get blank rows in your Google Sheet. Check your aggregation. Variables created inside an Iterator loop do not exist outside of it unless they are aggregated. Ensure your Aggregator includes every field you need.
“Data Structure Mismatch”
If Make refuses to let you map a field, your Parse JSON module likely has an outdated structure. Delete the current data structure and re-generate it with the latest JSON payload.
8. Conclusion: Build or Buy?
Parsing complex JSON in Make.com is a superpower. It allows you to connect any two systems, regardless of data format. By mastering the map() function and understanding the Iterator flow, you can handle most scenarios.
However, the remaining edge cases—dynamic keys and massive payloads—can paralyze a business. Thinkpeak.ai exists to solve those complex challenges.
- Need Speed? Visit our marketplace for plug-and-play templates.
- Need Scale? Our bespoke services build custom infrastructure that bypasses visual builder limitations.
Don’t let a bracket stop your growth. Transform your manual operations into a self-driving ecosystem today.
Ready to Automate?
Whether you need a single AI agent or a full-stack internal portal, we are your partner in engineering efficiency.
Frequently Asked Questions (FAQ)
How do I extract a value from a JSON array without iterating in Make.com?
Use the map() function combined with get(). The syntax is get(map(Array; ReturnValue; FilterKey; FilterValue); 1). This extracts a specific value based on a condition without using extra operations.
Why does Make.com show [Collection] instead of my data?
This indicates the system recognizes the data as an object but hasn’t “unpacked” it. You can use the `get(collection; “key_name”)` function to access data manually. Alternatively, ensure you have defined a Data Structure in your Parse JSON module.
How do I handle JSON with dynamic keys?
Use the toArray() function. It converts an object with dynamic keys into a standardized array of Key-Value pairs. You can then iterate through this array or use the map() function to filter by the “key” field.
Resources
- Your guide to the ‘Map’ function in Make.com | Joshua Thompson
- Type | Custom Apps Documentation | Make Developer Hub
- Processing of JSON strings inside a JSON object | Custom Apps Documentation | Make Developer Hub
- JSON Integration | Workflow Automation
- Your guide to the ‘Map’ function in Make.com – YouTube




