JSON Parser

Overview

This Snap reads JSON binary data from its input view and parses and writes it as JSON document data to its output view.


JSON Parser Configuration Settings

Prerequisites

  • A valid account with the required permissions.

Limitations and known issues

None.

Snap views

View Description Examples of upstream and downstream Snaps
Input This Snap has exactly one binary input view, where it gets the JSON binary data to be parsed. Mapper
Output This Snap has exactly one document output view, where it provides the JSON document data stream. Mapper
Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the pipeline by choosing one of the following options from the When errors occur list under the Views tab. The available options are:

  • Stop Pipeline Execution Stops the current pipeline execution when an error occurs.
  • Discard Error Data and Continue Ignores the error, discards that record, and continues with the remaining records.
  • Route Error Data to Error View Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap settings

Legend:
  • Expression icon (): Allows using JavaScript syntax to access SnapLogic Expressions to set field values dynamically (if enabled). If disabled, you can provide a static value. Learn more.
  • SnapGPT (): Generates SnapLogic Expressions based on natural language using SnapGPT. Learn more.
  • Suggestion icon (): Populates a list of values dynamically based on your Snap configuration. You can select only one attribute at a time using the icon. Type into the field if it supports a comma-separated list of values.
  • Upload : Uploads files. Learn more.
Learn more about the icons in the Snap settings dialog.
Field / Field set Type Description
Label String

Required. Specify a unique name for the Snap. Modify this to be more appropriate, especially if more than one of the same Snaps is in the pipeline.

Default value: JSON Parser

Example: Document Parse
Filter path String/Expression/ Suggestion

Required. The Filter path property specifies the JSON path to the filter to be applied when parsing the given JSON data. The Snap extracts the parts of data that applies to the filter condition. For more information regarding JSON path, refer to the site http://goessner.net/articles/JsonPath/

Default value: N/A

Example: $.items.item.[?]

$.items.item[?(@.price > 10)]

Non-standard JSON Checkbox Required. The Non-standard JSON property specifies whether or not the Component should allow non-standard features in the given JSON data.

Default status: Selected

Process array String/Expression
Required. The Process array property specifies whether or not the Component should take a root JSON array and writes each element of the array as a JSON document.
Note: Do not select this property if the input data is not in JSON lines format. If it has no newline character and its data size exceeds available memory, it may cause an out of memory error.

Default status: Selected

JSON lines Checkbox/Expression This property specifies the Snap's error handling when the input JSON data is newline-delimited JSON (JSON lines) and contains invalid JSON data:
  • If selected, the Snap writes an error and continues to parse the next JSON lines. The documents in a line after the invalid data are not parsed if the line contains more than one document. Lower performance is expected since the data is parsed one line at a time.
  • If not selected, the Snap writes an error and stops parsing. The Snap can parse JSON lines if each line has only one document.
Note: Do not select this property if the input data is not in JSON lines format. If it has no newline character and its data size exceeds available memory, it may cause an out of memory error.

Default status: Selected

Support Type Extensions Checkbox/Expression Select this checkbox to enable the Snap to format/parse the Snaplogic-specific syntax indicating objects of the special types, such as byte arrays and date objects in JSON. .

Default status: Deselected

Snap execution Dropdown list
Choose one of the three modes in which the Snap executes. Available options are:
  • Validate & Execute: Performs limited execution of the Snap and generates a data preview during pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during pipeline runtime.
  • Execute only: Performs full execution of the Snap during pipeline execution without generating preview data.
  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Default value: Validate & Execute

Example: Execute only
Note: JSON Parser Snap supports reading the input file in UTF-8 format only. However, when the input data from the upstream is a non UTF-8 format (such as ISO-8859-13, IBM01144, windows-1258 and so on), use the Transcoder Snap to decode the format back to the UTF-8 compliant and then parse the data.