> For the complete documentation index, see [llms.txt](https://docs.nedyx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nedyx.com/version-1.66/nedyx/clearlines-functions/range-functions/jsontorange.md).

# JSONTORANGE

#### Syntax

**JSONTORANGE**(*values*, *keys*)

1. *json* - a text in json format, from which the content is extracted as a range - ***Value type**: text*

#### Remarks

* In the result range, only the top 1-2 levels of the json string are converted to cell content
* Lower level content (level 3-n) is preserved as sub-json strings in the cells of the result range. This sub-json can be then extracted by subsequent calls of the JSONTORANGE function

#### Examples

**Example 1**: The json text contains a single json object. Only the values are returned in the result range.

<figure><img src="/files/8m9ijvv0Wyd8Ak0skbHm" alt=""><figcaption></figcaption></figure>

**Example 2** - The json contains multiple objects. They are returned as rows of the result range.

<figure><img src="/files/qf9pRLKKtP3tAKMh0DKj" alt=""><figcaption></figcaption></figure>

**Example 3** - The json contains an array with values. Each element of the array is added as a new row in the result range.

<figure><img src="/files/fiVW907nKBktePY6qy8G" alt=""><figcaption></figcaption></figure>

**Example 4** - The json contains an array nested in an array. In this case, the elements of the inner array are returned in one row in the result range.

<figure><img src="/files/UfqBNh9RcyLRewCFNjpW" alt=""><figcaption></figcaption></figure>

**Example 5** - The json contains multiple arrays nested in an array. The elements of each inner array are returned as separate rows in the result range.

<figure><img src="/files/H6YTsydzMUyetFENKapz" alt=""><figcaption></figcaption></figure>

**Example 6** - The json contains two arrays and an object nested in an array. The elements of both arrays and the object are returned as separate rows in the result range.

<figure><img src="/files/2RQ2i1k5oKgmCh3FmFYb" alt=""><figcaption></figcaption></figure>

**Example 7** - If the json contains a structure with more than 2 levels, it is possible to extract the content of lower-level values by subsequent calls of the JSONTORANGE function.

<figure><img src="/files/eKUFVSxDKzU0XMgmPQiT" alt=""><figcaption></figcaption></figure>
