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

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.

Example Results

1 examples

Group orders by status and export the result

Use one expression to compare how order states are distributed across two payload snapshots.

groupBy result preview
View input parameters
{ "jsonInput": "{\"orders\":[{\"id\":1,\"status\":\"paid\",\"total\":120},{\"id\":2,\"status\":\"pending\",\"total\":40}]}", "expression": "groupBy(orders, \"status\")", "outputFormat": "json" }

Key Facts

Category
Data & Tables
Input Types
textarea, select, checkbox, text
Output Type
html
Sample Coverage
4
API Ready
Yes

Overview

The JSONata Query & Transform Studio allows developers and data analysts to preview JSONata-style queries, transform complex JSON payloads, and compare results side-by-side. With support for standard JSONata expressions and built-in studio helpers, you can easily extract, group, or aggregate data and export the evaluated output as JSON, CSV, YAML, or Markdown.

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.

Examples

1. Grouping Orders by Status

Data Analyst
Background
An analyst receives a daily JSON export of e-commerce orders containing hundreds of records with various statuses.
Problem
Needs to quickly group the orders by their status to review the distribution and export the result for a spreadsheet.
How to Use
Paste the orders JSON into 'JSON Input', enter `groupBy(orders, "status")` in the 'JSONata Expression' field, and select 'CSV' as the Output Format.
Example Config
Output Format: csv
Outcome
The JSON array is transformed into grouped datasets by status and rendered as a CSV, ready for spreadsheet analysis.

2. Comparing API Responses

Backend Developer
Background
A developer is updating an API endpoint and needs to ensure the new payload structure still works with existing frontend transformation logic.
Problem
Needs to verify that a specific JSONata query yields the exact same result on both the old and new API responses.
How to Use
Paste the old API response in 'JSON Input', the new response in 'Comparison JSON Input', and enter the standard JSONata expression used by the frontend.
Outcome
The tool evaluates the expression against both payloads, allowing the developer to visually confirm that the outputs match perfectly.

Try with Samples

json, csv, yaml

Related Hubs

FAQ

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.

API Documentation

Request Endpoint

POST /en/api/tools/jsonata-query-transform-studio

Request Parameters

Parameter Name Type Required Description
jsonInput textarea Yes -
expression textarea Yes -
compareJsonInput textarea No -
outputFormat select No -
saveExpression checkbox No -
templateName text No -

Response Format

{
  "result": "
Processed HTML content
", "error": "Error message (optional)", "message": "Notification message (optional)", "metadata": { "key": "value" } }
HTML: HTML

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-jsonata-query-transform-studio": {
      "name": "jsonata-query-transform-studio",
      "description": "Preview JSONata-style queries and transformations, compare results across sample payloads, and export the transformed output as JSON, CSV, YAML, or Markdown",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=jsonata-query-transform-studio",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]