csv_json
Converts CSV text to JSON or JSON to CSV (direction: csv-to-json or json-to-csv), for data passed inline. CSV must be comma-separated, with a header row and at least one data row; double-quoted fields may contain commas. Semicolon- or tab-separated input is not detected and comes back as a single column. JSON input must be an array of objects: the union of their keys becomes the CSV header and missing values are left empty. Returns result (the converted text), rows and cols. Max 500,000 characters.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The CSV or JSON text to convert, matching the chosen direction. | |
| direction | Yes | Either 'csv-to-json' or 'json-to-csv'. |