# JSON

### JSON query

Extracts a JSON value and converts it to a SQL JSON-formatted STRING. –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#json_query)

```sql
JSON_QUERY(@expression, @expression_2)
```

#### Return type

string

#### Parameters

| Name            | Type                                                                                                                                                                                                                                                   | Allowed values                                                             | Required | Placeholder (in UI) |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | -------- | ------------------- |
| `@expression`   | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [string](https://docs.redivis.com/reference/datasets/variables#string) | true     | -                   |
| `@expression_2` | [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal)                                                                                                                               | any [string](https://docs.redivis.com/reference/datasets/variables#string) | true     | -                   |

### JSON value

Extracts a JSON scalar value and converts it to a SQL JSON-formatted STRING, removing outermost quotes and un-escaping return values –> [learn more](https://cloud.google.com/bigquery/docs/reference/standard-sql/functions-and-operators#json_value)

```sql
JSON_VALUE(@expression, @expression_2)
```

#### Return type

string

#### Parameters

| Name            | Type                                                                                                                                                                                                                                                   | Allowed values                                                             | Required | Placeholder (in UI) |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------- | -------- | ------------------- |
| `@expression`   | [variable](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#variable) or [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal) | any [string](https://docs.redivis.com/reference/datasets/variables#string) | true     | -                   |
| `@expression_2` | [literal](https://docs.redivis.com/reference/projects/transform-nodes/variable-creation-methods/common-elements#literal)                                                                                                                               | any [string](https://docs.redivis.com/reference/datasets/variables#string) | false    | *($)*               |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redivis.com/reference/workflows/transforms/variable-creation-methods/json.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
