transformations:constructjson
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
transformations:constructjson [2020/01/11 15:26] – created dmitry | transformations:constructjson [2020/01/11 15:44] – dmitry | ||
---|---|---|---|
Line 4: | Line 4: | ||
* Object per row, array from objects | * Object per row, array from objects | ||
* Array per column | * Array per column | ||
+ | |||
+ | A constructed JSON object is effectively a regular text value that is stored in a datagrid cell in EasyMorph. | ||
==== Mode " | ==== Mode " | ||
Line 23: | Line 25: | ||
" | " | ||
} | } | ||
+ | </ | ||
+ | |||
+ | If the source dataset contains multiple rows, they will be converted into an array of JSON objects where each object corresponds to one row. Example: | ||
+ | |||
+ | ^ ID ^ Name ^ | ||
+ | | 1 | Apple | | ||
+ | | 2 | Orange | | ||
+ | |||
+ | Result: | ||
+ | < | ||
+ | [ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | | ||
</ | </ | ||
==== Mode "Array per column" | ==== Mode "Array per column" | ||
+ | In this mode the source dataset is converted into a new dataset in which values of each column are rolled up into a JSON array. For instance the table from the example above would be converted into the following table: | ||
+ | |||
+ | ^ ID ^ Name ^ | ||
+ | | [1,2] | [Apple, | ||
+ | |||
==== Data type conversion ==== | ==== Data type conversion ==== | ||
Line 62: | Line 90: | ||
</ | </ | ||
Notice that Location is inserted as a JSON object, not as text. Field " | Notice that Location is inserted as a JSON object, not as text. Field " | ||
+ | |||
+ | ==== See also ==== | ||
+ | * [[https:// | ||
+ | * [[transformations: | ||
+ | * [[syntax: | ||
transformations/constructjson.txt · Last modified: 2022/10/02 20:16 by craigt