# 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    | *($)*               |
