JSON.PROCESS
This is a premium feature.
Traverses given JSON object and processes each cell in specified cell-range. Before the cell-range is processed the current JSON value is written to defined value cell, whereas the corresponding key is returned from the function itself. A nested JSON can be completely traversed by setting the optional recursive parameter to TRUE. To immediately stop the JSON traversal use BREAK()
in processed cell-range.
Syntax
=JSON.PROCESS(JSON, ValueCell, CellRange, [Recursive])
Arguments
Name | Description |
---|---|
JSON | A JSON object to process. |
ValueCell | Cell-reference to write current JSON value to. |
CellRange | Cell-range to process for each JSON value. |
Recursive (optional) | Specify TRUE to completely traverse a nested JSON object. Defaults to FALSE. |
Return
Currently processed JSON key or an error value.
Examples
Traverse simple JSON and process specified cell-range:
A1: {"name": "foo", "age": 42 }
A2: =CONCAT(A2, A4, "-")
A3: =CONCAT(A3, B3, "-")
Formula | Result | Comment |
---|---|---|
| age | Processes given cell-range for each JSON key-value pair. When finished A2 contains all the keys (-name-age- ) and A3 all the corresponding values (-foo-42- ) |