JSONTODATA Workflow Application

Overview

The JSONTODATA workflow application lets you parse JSON content into process data.

How it works

    The JSONTODATA application requires either the JSON_CONTENT or the JSON_CONTENT_FILE parameter; these correspond to the JSON to parse.
    The application supports the JSONPath query language (see https://github.com/json-path/JsonPath), which allows extraction of specific data from JSON content, similar to XPath expressions in XML.
    Application logs are available. These can be specified by setting the value of the JsonToDataLogLevel parameter in the web.config file to 0 to deactivate logs, 1 for error logs, 2 for information logs, or 3 for debug logs; the default value is 0.

Parameters

Parameter
Type
Direction
Description
JSON_CONTENT
TEXT
IN
Query to execute
JSON_CONTENT_FILE
FILE
IN
Query to execute, stored in a file

Parameter mapping

Using simple parameter names

The application supports custom OUT parameters to map simple JSON content.
📌 Example
1
{
2
"person": {
3
"address": {
4
"street": "160 Guy Street",
5
"zipcode": "J4G 1U4"
6
},
7
"age": 30,
8
"name": "John"
9
}
10
}
Copied!
The following parameters allow you to map the JSON content to different process data:
Parameter
Type
Direction
Retrieve the value into a data
Result
person.address.street
Text
OUT
DATA_STREET
160 Guy Street
person.address.zipcode
Text
OUT
DATA_ZIPCODE
J4G 1U4
person.age
Text
OUT
DATA_AGE
30
person.name
Text
OUT
DATA_NAME
John

Using JSONPath query language

The application supports the JSONPath query language, similar to XPath expressions in XML. This language allows you to retrieve specific data from a JSON. For more details regarding the JSONPath syntax, see https://github.com/json-path/JsonPath.
📌 Example
1
{
2
"person": {
3
"name": "Elizabeth",
4
"children": [
5
{
6
"name": "Charles",
7
"age": 30,
8
"children": [
9
{
10
"name": "Nathalie",
11
"children": [
12
{
13
"name": "George",
14
"age": 8
15
},
16
{
17
"name": "Charlotte",
18
"age": 10
19
},
20
{
21
"name": "Jefferson",
22
"age": 7
23
}
24
]
25
},
26
{
27
"name": "Harry"
28
}
29
]
30
},
31
{
32
"name": "Bob",
33
"age": 20,
34
"children": [
35
{
36
"name": "John"
37
},
38
{
39
"name": "Mark"
40
}
41
]
42
}
43
]
44
}
45
}
Copied!
In the above example, we want to get the names of Charles's grandsons who are older than seven years old, and we also want these names to be separated by a | (using the APP_JSONPATH_DELIMITER IN parameter). To get this information, the following parameters must be defined:
Parameter
Type
Direction
IN Value
OUT Value
APP_JSONPATH_DELIMITER
Text
IN
|
-
PARAM1__JSONPATH
Text
INOUT
person.children[?(@.name == 'Charles')].children[*].children[?(@.age > 7)].name
DATA1_VALUE (value will be: George|Charlotte)
    In the PARAM1__JSONPATH parameter name, the PARAM1 name is not relevant, but it must be followed by the __JSONPATH suffix (two underscores are used in the suffix).
    The default value of APP_JSONPATH_DELIMITER is a comma (,) when this parameter is not defined.
Last modified 7mo ago