# json_extract_path_text

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [cloud-data-platform-full.txt](https://docs.redpanda.com/cloud-data-platform-full.txt)

---
title: json_extract_path_text
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-connect-version: 4.93.0
latest-redpanda-tag: v26.1.9
docname: sql/sql-functions/json-functions/json-extract-path-text
page-component-name: cloud-data-platform
page-version: master
page-component-version: master
page-component-title: Cloud
page-relative-src-path: sql/sql-functions/json-functions/json-extract-path-text.adoc
page-edit-url: https://github.com/redpanda-data/cloud-docs/edit/main/modules/reference/pages/sql/sql-functions/json-functions/json-extract-path-text.adoc
description: The `json_extract_path_text()` function extracts JSON nested value from a specified JSON value according to the defined path.
page-topic-type: reference
page-git-created-date: "2026-05-26"
page-git-modified-date: "2026-05-26"
---

<!-- Source: https://docs.redpanda.com/cloud-data-platform/reference/sql/sql-functions/json-functions/json-extract-path-text.md -->

The `json_extract_path_text()` function extracts `json` nested value from a specified `json` value according to the defined path.

> 📝 **NOTE**
>
> This function may be similar to the `json_extract_path()`. This function returns a value of type text instead of type `json`.

## [](#syntax)Syntax

The `json_extract_path_text()` syntax is as follows:

```sql
JSON_EXTRACT_PATH_TEXT(from_json JSON, path TEXT[])
```

The required arguments are:

-   `from_json`: The `json` value to extract.

-   `path`: The path to extract.


### [](#another-option)Another option

Redpanda SQL also provides and supports the use of operators in queries. Here’s the syntax:

```sql
SELECT 'from_json'::JSON ->> 'path';
```

-   `from_json`: The `json` value from which to extract.

-   `::JSON`: A symbol that casts the text literal to a `json` type.

-   `path`: Key of the field to extract.


## [](#examples)Examples

1.  This example shows how to use the `json_extract_path_text()` function to extract values ​​from a `json` object at a specified index.

    Run the query:

    ```sql
    SELECT JSON_EXTRACT_PATH_TEXT('{"a": "Oxla", "b": {"x": 1.234, "y": 4.321}}', 'a') AS "result a";
    ```

    **or**

    ```sql
    SELECT '{"a": "Oxla", "b": {"x": 1.234, "y": 4.321}}'::JSON ->> 'a' AS "result a";
    ```

2.  The `json_extract_path_text()` function extracts the values and returns the output:

    ```sql
    +------------+
    | result a   |
    +------------+
    | Oxla       |
    +------------+
    ```