Categories

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 Processing
Input Types
textarea, select, checkbox, text
Output Type
html
Sample Coverage
4
API Ready
Yes

Overview

The JSONata Query & Transform Studio is a powerful utility designed to help developers and data analysts write, preview, and test JSONata expressions. It allows you to easily transform complex JSON payloads, compare query results across different data snapshots, and export your structured data into JSON, CSV, YAML, or Markdown formats for seamless integration into your workflows.

When to Use

  • Extracting specific fields or aggregating data from deeply nested JSON API responses.
  • Testing and debugging JSONata expressions against multiple data snapshots before deploying them to production.
  • Converting complex JSON payloads into flat CSV files or Markdown tables for reporting and documentation.

How It Works

  • Paste your primary JSON payload into the JSON Input field.
  • Write your JSONata expression to filter, map, or aggregate the data.
  • Optionally, add a second JSON payload to the Comparison input to see how the same expression handles different data structures.
  • Select your desired output format (JSON, CSV, YAML, or Markdown) and view the transformed results.

Use Cases

Filtering large e-commerce API responses to extract only paid orders and exporting them to CSV.
Comparing staging and production JSON configurations using a single transformation query.
Converting nested JSON log files into readable Markdown tables for technical documentation.

Examples

1. Group E-commerce Orders by Status

Data Analyst
Background
An analyst needs to summarize a raw JSON API response containing hundreds of orders to see how many are paid versus pending.
Problem
Manually sorting through nested JSON arrays to group data is time-consuming and prone to error.
How to Use
Paste the order JSON, enter `groupBy(orders, "status")` in the expression field, and select JSON or CSV as the output format.
Example Config
{"outputFormat": "csv"}
Outcome
The raw JSON is instantly transformed into a grouped structure, separating paid and pending orders for easy analysis.

2. Compare API Response Payloads

Backend Developer
Background
A developer is updating an API endpoint and needs to ensure the new JSON structure still works with existing data extraction logic.
Problem
Testing the same query against multiple JSON versions manually is tedious and makes it hard to spot discrepancies.
How to Use
Paste the old JSON in the primary input, the new JSON in the comparison input, and apply the extraction expression.
Example Config
{"saveExpression": true, "templateName": "API Version Test"}
Outcome
The tool processes both payloads side-by-side, verifying that the JSONata expression successfully extracts the required fields from both versions.

Try with Samples

json, csv, yaml

Related Hubs

FAQ

What is JSONata?

JSONata is a lightweight query and transformation language specifically designed for extracting and manipulating data within JSON documents.

Can I compare two different JSON payloads?

Yes, you can paste a second payload into the Comparison JSON Input field to see how your JSONata expression processes both datasets simultaneously.

What output formats are supported?

You can export your transformed data as JSON, CSV, YAML, or Markdown.

Can I save my JSONata expressions for later?

Yes, by checking the Save Expression box and providing a Template Name, you can store your query configuration for future use.

Is this tool suitable for flattening nested JSON?

Absolutely. You can write JSONata expressions to map nested objects into flat arrays and export the result directly to CSV.

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]