JSON Splitter

On this page

Snap type:

Transform


Description:

This Snap splits a list of values into separate JSON documents in its output view.

  • Expected input: JSON data to be split, in the form of JSON array.


Prerequisites:

[None]


Support and limitations:

Works in Ultra Pipelines.

Account: 

Accounts are not used with this Snap.


Views:
InputThis Snap has exactly one document input view, where it gets the JSON data to be split.
OutputThis Snap has exactly one document output view, where it provides the JSON document data stream.
Error

This Snap has at most one document error view and produces zero or more documents in the view.

If the Snap fails during the operation, an error document is sent to the error view containing the fields error, reason, original, resolution, and stacktrace:



Settings

Label


Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.  

Json Path


Required. Defines a path to the list that holds the document entries. Each entry of the list will be written out as a separate document.

Default value: None

Examples

  • $orders[*].orderlines[*]
  • $orders[*].orderlines[*].prod


Include scalar parents



Allows to include scalar parents in each output document. 
Example:
input:



using the split path on ['add 1 data'] will create 2 output documents,
doc1:


doc 2:



Enabling Include scalar parents will lead to:
doc1: 


doc 2: 

Default value: Not selected


Null-safe access

optional 

Allow to skip invalid path definitions that are defined in the Include Paths property below. The Snap will throw a DataException if disabled when the path does not exist in the input view. 

Default value: Not selected

Include paths

optional

Allows to include objects from the input document in the resulting output document(s)
Example:
input same as above.

A path such as  ['add 2 data'] will include the object in the output documents:

doc1:

Examples


Assume a pipeline starts with File Reader + JSON Parser + JSON Splitter.

The File Reader reads a JSON file with the following contents:

If the JSON path in the JSON Splitter is set to: 

$orders[*].orderlines 

The data output would look something like: 


See Also

Snap Pack History