Skip to content
background-image background-image

json_parser

JSON Parser

  • Version

    3.1

  • Agent restriction

    None

  • Processing type

    Row by row

  • Multi-input step

    Not Supported

The JSON parser connector parses the incoming JSON string into the internal Integray schema.

Automatic parsing

Parsing of JSON strings that directly correspond to flat or complex output schemas is done automatically without additional settings.

Column mapping

In cases where the JSON structure does not exactly match the output schema structure, the output schema mapping function must be used. It consists of key/value pairs, where Key is the name of the output schema and Value is the name of the JSON property. The JSONPath syntax can also be used to obtain nested tokens. The following table shows all the available placeholders and selectors that can be used:

Placeholders

Placeholder Description
${body} Entire parsed JSON.
${bodyBase64} Entire parsed JSON as Base64 string.
${body.row} Currently parsed JSON token.
${fixed:<value>} Predefined constant.
<token_name> Path to local token.
<token_name>.<nested_token_name> Path to nested token.
$.<JSONPath_expression> JSONPath expression.

Result path

Sometimes "useful" data is embedded deep in the JSON structure and cannot be iterated and parsed directly. In such cases, the parser can directly navigate to the token that contains the data.

Example

Suppose we have the following JSON response and we need to parse the users stored in the nested Data field. In this case, the column mapping mentioned earlier cannot be used because it cannot address multiple objects stored in the array.

{
   "Result":"OK",
   "Data":[
      {
         "FirstName":"Alice",
         "LastName":"Smith"
      },
      {
         "FirstName":"Bob",
         "LastName":"Johnson"
      }
   ]
}

Fortunately, we can set ResultPath to Data and move the parser to the desired location. After this move, the parser will 'see' the following JSON to parse:

[
    {
        "FirstName":"Alice",
        "LastName":"Smith"
    },
    {
        "FirstName":"Bob",
        "LastName":"Johnson"
    }
]

Such JSON can be easily parsed using the automatic parsing or column mapping mentioned above.

Configuration

JSON Format configuration

Result Path

Sometimes "useful" data is embedded deep in the JSON structure and cannot be iterated and parsed directly. In such cases, the parser can directly navigate to the token that contains the data. Suppose we have the following JSON response and we need to parse the users stored in the nested Data field. In this case, the column mapping mentioned earlier cannot be used because it cannot address multiple objects stored in the array.

{
   "Result":"OK",
   "Data":[
      {
         "FirstName":"Alice",
         "LastName":"Smith"
      },
      {
         "FirstName":"Bob",
         "LastName":"Johnson"
      }
   ]
}

Fortunately, we can set ResultPath to Data and move the parser to the desired location. After this move, the parser will ''see'' the following JSON to parse:

[
    {
        "FirstName":"Alice",
        "LastName":"Smith"
    },
    {
        "FirstName":"Bob",
        "LastName":"Johnson"
    }
]

Such JSON can be easily parsed using the automatic parsing or column mapping

Mapping

In cases where the JSON structure does not exactly match the output schema structure, the output schema mapping function must be used. It consists of key/value pairs, where Key is the name of the output schema and Value is the name of the JSON property. The JSONPath syntax can also be used to obtain nested tokens. The following table shows all the available placeholders and selectors that can be used:

Placeholder Description
${body} Entire parsed JSON.
${bodyBase64} Entire parsed JSON as Base64 string.
${body.row} Currently parsed JSON token.
${fixed:<value>} Predefined constant.
<token_name> Path to local token.
<token_name>.<nested_token_name> Path to nested token.
$.<JSONPath_expression> JSONPath expression.

Key

Name of the JSON property. The JSONPath syntax can also be used to obtain nested tokens. The following table shows all the available placeholders and selectors that can be used:

Placeholder Description
${body} Entire parsed JSON.
${bodyBase64} Entire parsed JSON as Base64 string.
${body.row} Currently parsed JSON token.
${fixed:<value>} Predefined constant.
<token_name> Path to local token.
<token_name>.<nested_token_name> Path to nested token.
$.<JSONPath_expression> JSONPath expression.

Input & Output Schema

Input

JSON to parse into the integray table.

JSON (ver. 1.0.0)

Column Data type Allow null Description
JSON JSON No Input/Output in JSON format

Output

Input schema is mandatory, but not specified by connector.

Release notes

3.1.0

  • Changed input schema from Text (1.0.0) to JSON (1.0.0)

3.0.4

  • Plugin binaries update as a result of included connector change.

3.0.3

  • Fixed shared nuget package versions.

3.0.2

  • Fixed right processing of nullable properties.