How to use the Convert JSON to CSV
- 1 Drop the JSON file on the studio, or paste it, or try the example.
- 2 In the flatten step, set “Rows come from” to the list that holds your records (the note under the step suggests it).
- 3 Choose how lists inside a row become columns: numbered columns, one joined cell or JSON text – or expand a list of objects into one row per item.
- 4 Export as CSV or Excel.
A table is flat, JSON is not
JSON describes trees: objects inside objects, lists inside lists. A CSV is a grid. Converting means deciding what each nested thing becomes, and doing it the same way for every record. The step makes those decisions explicit instead of hiding them.
- Rows: one row for each item of the list at the path you give (
orders,data.items). An object instead of a list gives one row. - Nested objects become columns named by their path:
customer.name,customer.city. - Lists of simple values become numbered columns (
tags.0,tags.1), one cell with the items joined by a separator you choose, or one cell with JSON text. - Lists of objects, such as order lines, can be expanded: list the path under “Expand into rows” and each line becomes its own row, with the order’s other values repeated.
What is kept exactly
JavaScript turns the id 12345678901234567890 into 12345678901234567000. The studio reads JSON itself and keeps the digits of numbers that a normal parser would change, including 1.50 and 1e3. Duplicate keys are reported, and the last one wins, as in most parsers.
What is lost, and said so
A table has no null: it becomes an empty cell, and the note counts them. Empty objects and lists have no column value. Nested values written as JSON text are counted too. If you need the nesting back later, use flatten nested JSON and its reverse instead.
Limits
JSON is specified in RFC 8259; files with comments, trailing commas or single quotes are refused with the line and column of the problem. JSON keys that are whole numbers are listed first by JavaScript, so their order can differ from the file – the studio warns when that happens.
Frequently asked questions
My JSON is an object with a list inside – where do the rows come from?
Set “Rows come from” to the path of that list, such as orders or data.items. Without a path you get one row for the whole object, and the note under the step suggests the list it found.
Can I get a row per order line?
Yes. Put the path of the lines under “Expand into rows”. The order values are repeated on each line row.
Are large numbers and decimals like 1.50 kept?
Yes. Numbers whose text would change in a normal JSON parser are kept digit for digit.
Last updated: