> ## Documentation Index
> Fetch the complete documentation index at: https://docs.databar.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# JQ formulas

> Parse, filter, and manipulate JSON fields using JQ expressions.

JQ formulas let you apply [JQ](https://jqlang.org/) queries to any JSON column in your table. The result is written into a new column (stored as JSON), giving you full control over nested data without leaving Databar.

<Info>
  JQ formulas are a **transformation**. They do **not** consume any credits.
</Info>

## What is JQ?

JQ is a lightweight command-line language designed for slicing, filtering, and transforming JSON data. It is particularly powerful when you need to dig into deeply nested objects or arrays that enrichment APIs return.

If you want to learn more, the [official manual](https://jqlang.org/manual/) is available, though it is fairly technical.

## Generate with AI

You don't need to learn JQ to use this feature. Databar has a built-in **Generate with AI** function that can write JQ expressions for you. Just describe what you need in plain language and the AI will generate the expression.

LLMs like ChatGPT and Claude are also excellent at generating JQ formulas. Describe your JSON structure and desired output, and they can produce a working expression in seconds.

## How to use

<Steps>
  <Step title="Add a JQ Formula transformation">
    Open your table and add a new transformation column. Select **JQ Formula** from the list.
  </Step>

  <Step title="Select the source JSON column">
    Choose which column contains the JSON data you want to query.
  </Step>

  <Step title="Write the JQ expression">
    Enter your JQ expression. The query runs per row and the result is stored as JSON in the new column.
  </Step>
</Steps>

## Use cases

| Scenario                   | Example expression                                     |
| -------------------------- | ------------------------------------------------------ |
| Count specific event types | `[.events[] \| select(.type == "purchase")] \| length` |
| Extract a nested value     | `.company.funding.last_round.amount`                   |
| Build a structured output  | `{name: .full_name, city: .address.city}`              |
| Filter an array            | `[.contacts[] \| select(.role == "CEO")]`              |

## Related

<CardGroup cols={2}>
  <Card title="JSON expander" href="/product-guide/json-expander">
    Extract JSON values into separate columns visually.
  </Card>

  <Card title="Excel formulas" href="/product-guide/formulas">
    Use spreadsheet formulas for simpler column logic.
  </Card>
</CardGroup>
