User Tools

Site Tools


transformations:parsejson

PARSE JSON

Category: Transform / Web


Description

Parse text values that are JSON objects into a tabular dataset.


Action settings

SettingDescription
Column The column containing the source JSON to be parsed.
JSONPath* The path to the JSON node from which parsing starts. Learn more about the path syntax.
Column names Select the method to be used to name columns in the result dataset.
Options: Property name, Full JSON path
Properties Select which properties to parse. One property corresponds to one column in the result dataset.
Options: Parse all properties or Parse selected properties (and select which properties to parse).

* Setting can be specified using a parameter.


Advanced options

Setting Description
Don't delete original columnWhen checked, the column with parsed JSON(s) will be kept in the result dataset.
Parsing modeSelect how nested JSON objects and arrays are turned into rows and columns. Options: Dense, Sparse (see "Parsing modes" below).


Parsing modes

Mode Description
DenseDefault option. Properties of nested objects are placed in the same row as their parent's properties, and a new row is created only for each array item.
SparseEach nested object gets its own row, and an empty column is added for each array, so the result has more rows and more empty cells.


Examples

Example #1

The data below was contained in the "Response-Body" column (kept for parsing). The column names ("date", "localName", etc.) are embedded within the data. (Line breaks have been inserted for clarity.)

Before (source table)

[{"id":"01","name":"John","Age":"23","Kids":true},
{"id":"02","name":"Louis","Age":"33","Kids":false},
{"id":"03","name":"Mark","Age":"44","Kids":false},
{"id":"04","name":"Tom","Age":"22","Kids":false}]

After (result table)

id name Age Kids
01 John 23 true
02 Louis 33 false
03 Mark 44 false
04 Tom 22 false

Action parameters

Column: Response-Body
JSON Path: <Root>
Column names: Property name
Properties: Parse selected properties
Selected properties: [*].id, [*].name, [*].Age, and [*].Kids


Community examples


See also

transformations/parsejson.txt · Last modified: by roberto

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki