SPARKPOND / GUIDE
How to Flatten Nested JSON into CSV
Nested object paths can become columns, while arrays need a selected tabular policy.
Problem symptoms
- A spreadsheet shows [object Object].
- Different records have different nested keys.
Why it happens
- JSON is hierarchical and CSV is rectangular.
- Arrays may contain scalars, objects or mixed values.
Example before and after
Before
{"id":1,"person":{"name":"Ada","city":"Paris"}}After
id,person.name,person.city 1,Ada,Paris
Procedure
- Inspect the union of object paths.
- Choose path notation.
- Select a policy for every nested array.
- Preview columns and missing fields, then export.
Common mistakes
- Joining complex arrays with commas without preserving structure.
- Using only the first record to define columns.
Other possible solutions
- Keep NDJSON when hierarchy matters more than spreadsheet compatibility.
Important limitations
- Some heterogeneous nested arrays cannot be represented losslessly in one CSV row.