🐰 RabbitJson - Help

← Back to App

Welcome to RabbitJson

RabbitJson is a simple tool to transform JSON data into formatted text using a three-step process: extract arrays from JSON, then transform them using template strings.

Path Expression

Use path expressions to extract arrays from your JSON data:

Example 1: Simple Property

1. JSON Input:
{
  "books": [
    {"name": "Book A", "price": 10},
    {"name": "Book B", "price": 20}
  ]
}
2. Path Expression:
books
3. Extracted Array:
[
  {"name": "Book A", "price": 10},
  {"name": "Book B", "price": 20}
]

Example 2: Nested Path

1. JSON Input:
{
  "data": {
    "books": [
      {"name": "Book A", "price": 10},
      {"name": "Book B", "price": 20}
    ]
  }
}
2. Path Expression:
data.books
3. Extracted Array:
[
  {"name": "Book A", "price": 10},
  {"name": "Book B", "price": 20}
]

Example 3: Array Index

1. JSON Input:
{
  "items": [
    {"id": 1, "tags": ["a", "b"]},
    {"id": 2, "tags": ["c", "d"]}
  ]
}
2. Path Expression:
items[0].tags
3. Extracted Array:
["a", "b"]

Template String

Use template strings to format your output. Variables are enclosed in ${} syntax:

Example 1: Variable Substitution

1. Extracted Array:
[
  {"name": "Book A", "author": "Author 1"},
  {"name": "Book B", "author": "Author 2"}
]
2. Template String:
Book: ${name} by ${author}
3. Transformation Result:
Book: Book A by Author 1
Book: Book B by Author 2

Example 2: Math Operations

1. Extracted Array:
[
  {"name": "Product A", "price": 100},
  {"name": "Product B", "price": 200}
]
2. Template String:
${name}: $${price} (with tax: $${price * 1.1})
3. Transformation Result:
Product A: $100 (with tax: $110)
Product B: $200 (with tax: $220)

Example 3: Complex Expressions

1. Extracted Array:
[
  {"item": "Item A", "price": 100, "qty": 2},
  {"item": "Item B", "price": 50, "qty": 3}
]
2. Template String:
${item}: ${qty} x $${price} = $${price * qty}
3. Transformation Result:
Item A: 2 x $100 = $200
Item B: 3 x $50 = $150