# 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/zrKB2DD9AAhJtXUB6eVH" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/1irCHt5DERVOKGds1ZTF" 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/47RO5FTMR1l0N8m6sslP" 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/Y8lUOv6xC6UBFaBqwr3w" 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/RgT6bzP0PZwyN9iw68Gs" 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/E4NL3CvmF3zJWD2Lg7gl" 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/juMorzv2uy4ROkXFje4Y" alt=""><figcaption></figcaption></figure>


---

# 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.nedyx.com/nedyx/clearlines-functions/range-functions/jsontorange.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.
