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

# GET_PATH

> Extracts a value from a VARIANT using a path and returns it as VARIANT.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

NULL value/path, missing paths, out-of-range indices and syntactically invalid nonempty paths produce SQL NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
get_path(value, path)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | VARIANT | Yes | Value to navigate. |
| path | STRING | Yes | Path into value. Dot or colon field access, non-negative zero-based array indices and double-quoted bracket keys. |

## Returns

* Type: VARIANT
* NULL behavior: NULL value/path, missing paths, out-of-range indices and syntactically invalid nonempty paths produce SQL NULL.
* Shape: A VARIANT scalar, object, or array. This is a VARIANT value rather than an ordinary SQL STRUCT.
* Ordering: Array element order is preserved; object-key order is not a SQL ordering guarantee.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Usage notes

* An empty path string extracts the whole value. Outside Snowflake a leading JSONPath \$ is stripped; in Snowflake \$ is a literal field prefix.
* The path can be a constant STRING or a STRING expression that varies by row.
* Deterministic: The same inputs and settings produce the same result.

## Examples

### Display depends on the SQL dialect

* Non-Snowflake context; Snowflake uses path a\[1].
* The table shows the logical VARIANT value. Your SQL client may display it differently.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT get_path(parse_json('{"a":[10,20]}'), '$.a[1]') AS "value";
```

| value |
| - |
| 20 |

### Read a nested field

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT get_path(parse_json('{"user":{"name":"Ada"}}'), '$.user.name') AS user_name;
```

| user\_name |
| - |
| Ada |

## Limitations

* Use the path syntax shown here. Do not assume support for every JSONPath wildcard or negative-index form.
* Argument type errors or corrupt VARIANT encoding can raise errors.

## Related functions

* [variant\_get](/query/sql/functions/json/variant_get)
* [parse\_json](/query/sql/functions/json/parse_json)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.