Share
Explore

Working with JSON in Coda

Pretty print JSON or convert to YAML or CSV in one click

How to use?

Tired of long and ugly JSON?
{"version": 1, "answers": {"name": "wrench", "mass": "1.3kg", "count": 3}, "tags": ["tool", "gear"]}

Pretty print

Apply the JSON() formula on it (don’t forget to wrap the value with single quotes), and you’ll get a pretty printed JSON
{ "version": 1, "answers": { "name": "wrench", "mass": "1.3kg", "count": 3 }, "tags": [ "tool", "gear" ] }

YAML

If you’d like to have a nice text representation without brackets, use YAML() formula instead
version: 1 answers: name: wrench mass: 1.3kg count: 3 tags: - tool - gear

CSV

You can also convert JSON to CSV using CSV() formula, for example JSON:
[{"name":"John Doe","age":30,"email":"john.doe@example.com","address":"123 Main St, Anytown, CA 12345"},{"name":"Jane Smith","age":25,"email":"jane.smith@example.com","address":"456 Oak St, Anytown, CA 12345"}]
And its CSV representation:
"name","age","email","address" "John Doe",30,"john.doe@example.com","123 Main St, Anytown, CA 12345" "Jane Smith",25,"jane.smith@example.com","456 Oak St, Anytown, CA 12345"
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.