In this section · 02 Read itTable
02 · Read it · Four ways to read a JSON document
The Table view and its export
Any array of records as rows and columns, drilled level by level, and written out as CSV or a Markdown table.
Input
[
{ "sku": "PEN-01", "qty": 2, "ship": { "city": "Berlin", "zip": "10115", "eu": true } },
{ "sku": "PAD-02", "qty": 5, "ship": { "city": "Lyon", "zip": "69001", "eu": true }, "gift": true },
{ "sku": "MUG-07", "qty": 1 }
]Do
- Paste the document and switch a pane to Table.
- Press Export in the pane toolbar, leave the format on CSV and press Download.
- Set the format to Markdown and download again.
- Back in the grid, click a
{3}badge in the ship column to drill into it, then export that level too.
Result
CSV
#,sku,qty,ship,gift
0,PEN-01,2,"{""city"":""Berlin"",""zip"":""10115"",""eu"":true}",
1,PAD-02,5,"{""city"":""Lyon"",""zip"":""69001"",""eu"":true}",true
2,MUG-07,1,,
Markdown
| # | sku | qty | ship | gift |
| ---: | ------ | ---: | ---------------------------------------- | ---- |
| 0 | PEN-01 | 2 | `{"city":"Berlin","zip":"10115","eu":true}` | |
| 1 | PAD-02 | 5 | `{"city":"Lyon","zip":"69001","eu":true}` | true |
| 2 | MUG-07 | 1 | | |
Drilled into the first row’s ship
key,value
city,Berlin
zip,10115
eu,trueAn array of objects is already a table; the Table view just draws it as one. It is part of the four ways to read a document, and it is the one that makes a list of records comparable — twenty orders with a field missing from three of them is a paragraph of careful reading in a tree and one glance in a grid.
What becomes a column
The columns are the union of the keys across the rows, in the order they are first seen. The first record contributes its keys in its own order, the second adds any the first did not have, and so on. So in the example above the columns are sku, qty, ship and then gift, which only the second record has.
They are never sorted alphabetically, and that is deliberate. Source order is information — whoever wrote the document put the identifier first for a reason — and sorting would also mean the column layout reshuffled itself whenever a record with a new key arrived. The order you see is the order the data is in.
A record that is missing a key shows an empty cell there rather than a zero or a null, because a field that was never written is not the same as a field written as nothing. That distinction survives all the way into an export: in the CSV above, the third row’s ship and gift positions are empty rather than filled with a placeholder.
Rows that are not objects are handled too. An array of numbers, or a mixture of objects and values, gets a single value column rather than refusing to tabulate — so the view works on whatever you have, not only on the tidy case.
Drilling in, and finding your way back
A cell holding an object or an array shows a badge instead of its contents: {3} for an object with three keys, [5] for an array of five. Click the badge and the table navigates into that value, so the nested object becomes the table you are looking at. The third run of the example is exactly that — one level down, exported from there.
Along the top, a breadcrumb shows where in the document you are, one step per level, starting at the root. Clicking any step goes back to it. That is the whole navigation model: badges take you in, the breadcrumb takes you out, and the document itself is untouched throughout.
Exporting what you are looking at
Export in the pane toolbar opens a small card with the settings for the file it will write: the format, the delimiter for the delimited formats, and two checkboxes — Header row and Row labels. Row labels are the leading column of keys or indices; in the example they are the # column with 0, 1 and 2 in it.
The export writes the level you are looking at, not the whole document. Drill into a nested object and export, and you get that object. That is why the breadcrumb matters before you press: it is showing you what is about to be written.
A cell that holds an object or an array cannot be a spreadsheet cell, so it is written as compact JSON — that is what the quoted braces in the CSV above are. It is not pretty, and it is the only choice that keeps the data and lets it round-trip; the alternative, writing the badge, would export {3} and lose everything.
Markdown is the same table as a GitHub-flavoured one, with the columns padded so the source lines up and numeric columns aligned right. Nested values become code spans and a value containing a line break is written as <br>, because a Markdown table cell cannot contain a newline. It is the format to use when the table is going into a pull request or a document rather than into a spreadsheet.
Two small differences between the block above and the file you get. The downloaded file uses CRLF line endings and starts with a byte-order mark, which is what makes Excel read it as UTF-8 rather than as the local code page; neither is visible, and printing them here would only be noise. And Copy on the card always writes tab-separated text with plain line breaks, because that is what pasting into a spreadsheet expects.
Editing in the grid
The Table is not read-only. Cells can be edited in place, which is the quickest way to fix a handful of records, and an empty cell can be filled — that inserts the key into that record rather than writing a null into it, so the record comes out shaped like its neighbours. The editing guide covers that alongside the tree and the graph.
Open the editor, paste an array of records and switch a pane to Table, or go back to Four ways to read a JSON document for the other three views.