Table plus |
---|
applyColStyleToCell | true |
---|
heading | 0 |
---|
columnTypes | s,s,s,s |
---|
multiple | false |
---|
columnAttributes | style="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold, |
---|
enableSorting | false |
---|
|
Syntax | fromJson(json) | Package | | Alias | | Pkg Usage | |
|
Description
Excerpt |
---|
|
Converts the given JSON string into a SIL type (can be a primitive, array or struct). |
Converts the given JSON string into a SIL type (can be a primitive, array or struct).
...
Table plus |
---|
applyColStyleToCell | true |
---|
columnTypes | s,s,s,s |
---|
heading | 0 |
---|
multiple | false |
---|
enableSorting | false |
---|
|
Parameter name | Type | Required | Description |
---|
json | String | Yes | The JSON to be converted. |
|
Return Type
String
Variable return type depends on the left hand side operator type.
...
Both examples show how JSON data can be parsed into an array or struct collections. Both examples use the following struct definitions:
Code Block |
---|
<ac:structured-macro ac:name="code" ac:schema-version="1"><ac:parameter ac:name="language">cpp</ac:parameter><ac:parameter ac:name="theme">Eclipse</ac:parameter><ac:parameter ac:name="linenumbers">true</ac:parameter><ac:plain-text-body>struct code struct code {
number [] rgba;
string hex;
}
struct color {
string color;
string category;
string type;
code code;
}
struct colors {
color [] colors;}</ac:plain-text-body></ac:structured-macro> |
...
Code Block |
---|
string json = readFromTextFile("C:\\colors.json");
colors [] cData;
cData = fromJson(json);
return cData.colors[0].color; |
...
Code Block |
---|
string json = "{\"colors\":[{\"color\":\"red\",\"category\":\"hue\",\"type\":\"primary\",\"code\":{\"rgba\":[255,0,0,1],\"hex\":\"#FF0\"}}]}";
colors [] cData;
cData = fromJson(json);
return cData.colors[0].color; |
See also
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 25 |
---|
showSpace | false |
---|
cql | label = "http_routine" and space = currentSpace ( ) |
---|
labels | array_routines |
---|
|