# Row inspector

The row inspector opens the selected table row beside the grid as a tree of its values. Search inside it, follow foreign keys without leaving it, or edit the row as a JSON document.

## Where to find it

| Action | How |
| --- | --- |
| Open or close the inspector | `Space` on a row in a table's data grid, or `Details` above the grid |
| Previous or next row | `⌘ArrowUp` (`Ctrl+ArrowUp`) and `⌘ArrowDown` (`Ctrl+ArrowDown`) |
| Search the row | `⌘F` (`Ctrl+F`) with focus in the panel |
| Next or previous match | `⌘G` (`Ctrl+G`) and `⌘⇧G` (`Ctrl+Shift+G`) |
| Copy the focused value | `⌘C` (`Ctrl+C`) |
| Copy the focused subtree as JSON | `⌘⇧C` (`Ctrl+Shift+C`) |
| Switch between fields and JSON | `Fields` and `JSON` in the panel header, or `⌘⇧J` (`Ctrl+Shift+J`) |
| Apply a JSON draft | `Apply`, or `⌘Enter` (`Ctrl+Enter`) |

## The value tree

Each column is one row of the tree, with its name and type on the left and its value on the right. A JSON column opens as objects and arrays you expand in place, and a collapsed container shows how many keys or items it holds. `NULL` is italic and a boolean carries a dot. A `text` column that holds a JSON object or array also opens as a tree, and its context menu offers `View as text` and `Copy raw text`.

![The books grid with the inspector open on row 17: isbn shows an italic NULL, in_print shows true with a dot, and metadata is expanded into an empty awards array, a genres array with poetry and fiction, and a series object.](https://bobbytables.app/docs/img/row-inspector/01-value-tree.png)

_JSON columns expand in place._

![A scratch row whose text column payload is shown as a tree of nested and deep with the values 1, 2 and 3, and the field's context menu open with Copy value, Copy subtree as JSON, Copy raw text and View as text.](https://bobbytables.app/docs/img/row-inspector/02-serialized-json.png)

_Text that holds JSON opens as a tree._

## Search

Press `⌘F` in the panel to search column names, JSON keys and values together. Matches are highlighted, and the count reads `3 matches` until you step with `Enter`, then `1 of 3`. `Show matches only` hides every field that does not match, so a narrowed object reads, for example, `3 of 4 keys`. `Regular expression` reads the query as a pattern.

[On orders row 4, Command F focuses the search box, typing co highlights three matches in shipping_address, Enter steps to 1 of 3, and Show matches only narrows the panel to shipping_address with 3 of 4 keys.](https://bobbytables.app/docs/video/row-inspector/03-search.mp4)

_Stepping moves to each match, and matches only hides the rest._

![The inspector search in regular expression mode with a pattern for names ending in _at or _unix, reporting 3 matches and highlighting placed_at, placed_unix and updated_at.](https://bobbytables.app/docs/img/row-inspector/04-regex-search.png)

_A pattern can match column names as well as values._

## Foreign keys

A foreign key field lists the table it points to, such as `→ bookshop.books`, under its value. Expand it to load the referenced row in place, with its own fields and keys. Expand a key inside that row to follow the chain further, so `order_items`, `books` and `authors` read as one panel. A table that other rows point to lists them under `Referenced by`.

![An order_items row with book_id expanded into books row 14, and that row's author_id expanded into authors row 20, Dakota Ledger.](https://bobbytables.app/docs/img/row-inspector/05-foreign-keys.png)

_Each expanded key loads the referenced row in place._

## Copying and wrapping

The `…` menu in the panel header holds `Expand all`, `Collapse all`, `Wrap text`, `Show matches only`, `Regular expression` and `Automatically expand relationships`. `Copy row as JSON` copies the row, and `Copy visible structure` copies what the panel shows, related rows included.

![The panel menu open over the inspector, listing Expand all, Collapse all, Wrap text with a check, Show matches only, Regular expression, Automatically expand relationships, Copy row as JSON and Copy visible structure.](https://bobbytables.app/docs/img/row-inspector/06-panel-menu.png)

_Display and copy commands share one menu._

## JSON view

Choose `JSON` in the panel header to see the row as one JSON document in an editor. Change values, then choose `Apply` or press `⌘Enter`. Each changed column becomes a pending edit in the grid, and nothing reaches the database until you commit. `Discard` drops the draft.

![Customers row 1 in the JSON view with notifications inside preferences changed to true, and Discard and Apply Command Enter in the footer.](https://bobbytables.app/docs/img/row-inspector/07-json-view.png)

_Edits stay in the editor until you apply them._

![The customers grid after applying the draft, with row 1's preferences cell highlighted as pending and the bar reading 1 change, 1 edited, with Discard, Preview and Commit.](https://bobbytables.app/docs/img/row-inspector/08-pending-after-apply.png)

_Applying turns the draft into ordinary pending edits._

## Good to know

- The inspector is part of a table's `Data` view. Query results use Quick Look instead.
- Referenced rows are read-only in the panel.
- The view and the menu switches are remembered, but the search text is not.
- Pending edits from the JSON view are committed like any other edit. See [Editing rows](https://bobbytables.app/docs/editing).

## Related

- [Table data](https://bobbytables.app/docs/table-data.md)
- [Editing rows](https://bobbytables.app/docs/editing.md)
- [Results grid](https://bobbytables.app/docs/results.md)
