# JSONata Query & Transform Studio

Preview JSONata-style queries and transformations, compare results across sample payloads, and export the transformed output as JSON, CSV, YAML, or Markdown

> Canonical page: https://elysiatools.com/en/tools/jsonata-query-transform-studio

- **Category:** Data Processing

- **Keywords:** jsonata, json transform, json query, csv export

## Overview

Paste a JSON object or array into "JSON Input", then enter a JSONata expression in "JSONata Expression".

How to fill the fields:
- JSON Input: the primary JSON payload to query or transform
- JSONata Expression: a standard JSONata expression, or one of the studio helper forms like groupBy(orders, "status")
- Comparison JSON Input: optional second payload evaluated with the same expression so you can compare outputs side by side
- Output Format: renders the evaluated result as JSON, CSV, YAML, or Markdown
- Save Expression: stores the current expression in local history
- Template Name: optional name shown in the saved-expression history

Supported expression styles:
- Standard JSONata, such as $sum(orders.total) or orders[status="paid"]
- Studio helpers without the $ prefix:
  - groupBy(collection, "field.path")
  - mapField(collection, "field.path")
  - flatten(collection)
  - distinct(collection)
  - count(collection)
  - sum(collection)
  - avg(collection)
  - keys(object)

Example inputs:
- JSON Input: {"orders":[{"id":1,"status":"paid","total":120},{"id":2,"status":"pending","total":40}]}
- Expression: groupBy(orders, "status")
- Expression: sum(orders.total)
- Expression: orders[status="paid"]

Notes:
- The tool uses the real jsonata runtime and preprocesses the helper names above into callable functions.
- Comparison JSON is optional but useful when validating the same transform across two API responses or test fixtures.

## Inputs

- **JSON Input** (textarea): {"orders":\[{"id":1,"status":"paid","total":120}\]}
- **JSONata Expression** (textarea): groupBy(orders, "status")
- **Comparison JSON Input** (textarea): {"orders":\[{"id":2,"status":"pending","total":55}\]}
- **Output Format** (select)
- **Save Expression** (checkbox)
- **Template Name** (text): Paid order totals

## When to use

- When you need to extract specific fields, filter arrays, or aggregate values from a large JSON API response.
- When comparing how a single JSONata transformation applies to two different JSON payloads side-by-side.
- When converting complex nested JSON data into flat CSV, YAML, or Markdown formats for reporting or documentation.

## How it works

- Paste your primary JSON object or array into the JSON Input field.
- Enter a standard JSONata expression or use a built-in helper like groupBy(collection, "field") in the JSONata Expression field.
- Optionally, provide a Comparison JSON Input to evaluate the same expression against a second payload.
- Select your desired Output Format to render the transformed data as JSON, CSV, YAML, or Markdown.

## Use cases

- Grouping e-commerce order data by status to calculate totals and exporting the summary as a CSV file.
- Validating data transformation logic across staging and production API responses using the comparison feature.
- Flattening deeply nested configuration files and converting them into readable Markdown or YAML documentation.

## Frequently asked questions

### What expression styles are supported?

The tool supports standard JSONata expressions (like $sum(orders.total)) as well as simplified studio helpers without the $ prefix, such as groupBy() and flatten().

### Can I compare two different JSON payloads?

Yes, you can paste a second payload into the Comparison JSON Input field to see how the same expression evaluates against both datasets side-by-side.

### What output formats can I export to?

You can render and export your transformed data as JSON, CSV, YAML, or Markdown using the Output Format dropdown.

### Are my JSONata expressions saved?

You can check the Save Expression box and provide a Template Name to store your current expression in your local browser history for future use.

### Does this tool use the real JSONata runtime?

Yes, it uses the official JSONata runtime while preprocessing the studio helper functions to make them directly callable.

## Related tools

- [Markdown Table Generator](https://elysiatools.com/en/tools/markdown-table-generator): Generate formatted Markdown tables from CSV, JSON, or array data with alignment, header styles, width control, and merge hints
- [BOM Character Remover](https://elysiatools.com/en/tools/data-bom-remover): Remove BOM (Byte Order Mark) characters from text and file content. Perfect for cleaning up text files that have encoding issues, fixing CSV imports, and preparing data for processing. Features: - Detect and remove UTF-8 BOM (EF BB BF) - Detect and remove UTF-16 BOM (FE FF or FF FE) - Detect and remove UTF-32 BOM (00 00 FE FF or FF FE 00 00) - Support multiple input formats - Visual BOM character display - Detailed detection report - Support for batch text processing Common Use Cases: - Fix CSV file import errors - Clean up text file encoding issues - Prepare data for JSON parsing - Fix XML parsing problems - Resolve API data encoding conflicts - Standardize text data format
- [Markdown Table to CSV JSON with Type Inferred Schema](https://elysiatools.com/en/tools/markdown-table-to-csv-json-schema): Convert a Markdown pipe table to CSV, JSON rows or an inferred JSON Schema with alignment and null diagnostics
- [Messy Text to Structured Data Workbench](https://elysiatools.com/en/tools/messy-text-to-structured-data-workbench): Infer tables from pasted text, mixed delimiters, key-value lines, or HTML and export CSV, JSON, and Markdown.
- [JSON to CSV Converter](https://elysiatools.com/en/tools/json-to-csv): Convert JSON data to CSV format with customizable formatting options
- [Structured Log Analyzer](https://elysiatools.com/en/tools/structured-log-analyzer): Detect common log formats, extract core fields, infer field types, and export parsed logs as JSON, CSV, or SQL inserts
- [Text to Excel Converter](https://elysiatools.com/en/tools/text-to-excel): Convert various text formats to Excel with customizable parsing and formatting options
- [PDF Table Extractor to CSV/JSON](https://elysiatools.com/en/tools/pdf-table-extractor-to-csv-json): Extract tables from PDFs with OpenDataLoader and export them as structured JSON, flat CSV, or HTML tables

## Samples

- [CSV Samples](https://elysiatools.com/en/samples/csv-samples): Sample CSV files with various data types, sizes, and complexity levels
- [Python Samples](https://elysiatools.com/en/samples/python): Essential Python code examples and Hello World demonstrations
- [OpenAPI/Swagger Samples](https://elysiatools.com/en/samples/openapi-swagger): Comprehensive API documentation examples using OpenAPI 3.0 and Swagger specifications for RESTful services
- [Distributed Tracing Samples](https://elysiatools.com/en/samples/distributed-tracing-samples): Comprehensive distributed tracing examples using Jaeger, OpenTelemetry, and other modern observability tools for microservices architecture

## Related content

- [JSON Inspection, Diff, and Transformation Tools](https://elysiatools.com/en/hubs/json-utility): Compare JSON formatting, diffing, path inspection, schema validation, merging, transformation, and export tools in one hub for API and data workflows.
- [JSON Schema, Mock Data, and API Fixture Generators](https://elysiatools.com/en/hubs/json-generate): Curated tools for JSON schema generation, mock payload building, and API fixture preparation in one hub.
- [Observability, Log Analysis, and Trace Debugging Tools](https://elysiatools.com/en/hubs/observability-debugging): Parse logs, inspect traces, compare API payload drift, and turn raw observability data into timelines, diagrams, and structured evidence for faster debugging.
- [JSON Interchange and Format Translation Tools](https://elysiatools.com/en/hubs/json-convert): Compare JSON conversion tools for CSV, YAML, TOML, GraphQL, XML, Markdown, Excel, BSON, EDN, and related structured formats in one hub.
