Retrieve values from a provided JSON. Use JSON path to indicate the text to be retrieved from the JSON.
You can find more information on how to use JSON path at this link: https://pypi.org/project/jsonpath-ng/
Review JSON Configuration Instructions below
Application
Text
Inputs (what you have)
Name | Description | Data Type | Required? | Example |
JSON Text | Text in JSON format that you are looking to retrieve values from | Text (Long) | Yes | {“key”:”value”} |
JSON path | The JSON path to the object or value in the text you would like to retrieve. | Text (Long) | Yes | $.key |
Fields to capture name | The name of the field to capture in which to add the JSON value | Text (Short) | Yes | Field1 |
Format outputs as an array? | Format outputs as an array | True/False | No | True |
Note: the value of inputs can either be a set value in the configuration of the Wrk Action within the Wrkflow, or a variable from the Data library section. These variables in the Data library section are the outputs of previous Wrk Actions in the Wrkflow.
Outputs (what you get)
Name | Description | Data Type | Required? | Example |
Fields to capture | A new field to add the value from the input JSON. This field name must match the value in New field name | Text (Long) | Yes | Field1 |
Outcomes
Name | Description |
Success | This status is selected if details are extracted from the JSON. |
No result | This status is selected in the event of the following scenarios:
|
Unsuccessful | This status is selected in the event of the following scenarios:
|
JSON Path Configuration Instructions
Atomic expressions:
Syntax | Meaning |
$ | The root object |
`this` | The “current” object. |
`foo` | More generally, this syntax allows “named operators” to extend JSON path in arbitrary ways |
field | Specified field(s), described below |
[ field ] | Same as field |
[ idx ] | Array access, is described below (this is always unambiguous with field access) |
Jsonpath operators:
Syntax | Meaning |
jsonpath1 . jsonpath2 | All nodes matched by jsonpath2 starting at any node matching jsonpath1 |
jsonpath [ fieldname ] | Same as jsonpath.fieldname |
jsonpath1 .. jsonpath2 | All nodes matched by jsonpath2 that descend from any node matching jsonpath1 |
jsonpath1 where jsonpath2 | Any nodes matching jsonpath1 with a child matching jsonpath2 |
jsonpath1 | jsonpath2 | Any nodes matching the union of jsonpath1 and jsonpath2 |
Field specifiers ( field ):
Syntax | Meaning |
fieldname | the field fieldname (from the “current” object) |
"fieldname" | same as above, for allowing special characters in the fieldname |
'fieldname' | ditto |
* | any field |
field , field | either of the named fields (you can always build an equivalent JSON path using |) |
Array specifiers ( idx ):
Syntax | Meaning |
[n] | array index (may be comma-separated list) |
[start?:end?] | array slicing |
[*] | any array index |
Functions
name | Example |
len |
|
sub | Surround your regex with /regex/
|
split |
*the spaces after the separating commas are required |
sorted |
*Use / to sort ascending and \ to sort descending |
filter |
Supported operators:
Properties can only be compared to static values. Note: If filtering using =~ then the entire array being filtered must be objects or strings. You cannot use this feature for integers, boolean, or nulls. |
arithmetic (-+*/) |
|
String joins / concatenation |
|
Version# 1.0