Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

Input Format "Json"

This input format allows you to split a JSON file representing a batch of documents into the individual documents, and to extract or add related file attachments to the JSON file.

Property

Description

InputFormat[].DocProperty

Definition of the property in a JSON file, based on which this file will be split into separate document-specific parts (optional)

By default, a JSON file is assumed to contain only one document.

When splitting, the original document is discarded and a copy of the original document is generated instead for each new partial document. The document-specific part of the original CSV file is added to this copy as another attachment.

The split documents generated are given the name suffix .splitN, in which N represents a serial number.

The syntax to use for specifying the property is JSONPath, which is the same as that used for extracting index data (see JSON index data reader). For example, if the JSON object contains a Documents array with the individual documents, the property value might be $.Documents.

{ "Documents": [ {…}, {…} ] }

InputFormat[].AttachFileMode

Mode determining how additional file attachments are extracted from or added to the JSON file:

  • None: no extraction/addition (default value)

  • Name: based on the name of the JSON file

  • Reference: based on the reference in the JSON file

  • Embedded: binary data embedded in the JSON file

When using the Name and Reference modes, the JSON file be brought into the system through the file system, since the additional file attachments are searched for only in the file system.

InputFormat[].AttachFileProperty(*)

This property applies to the Reference and Embedded modes.

Subparameters in JSONPath syntax for defining the properties that contain data concerning the file attachments

  1. File*: relative/absolute file path or Base64-encoded binary data of the file attachment

  2. Name: name of the file attachment

  3. Type: type or MIME type of the file attachment

Parameters 2 and 3 only apply to the Embedded mode. Here, specify absolute paths for all parameters, since the JSONPath syntax does not know a reference to the parent element.

Further subparameters of freely selectable names are permitted. These parameters are added to the file attachments as metadata.

InputFormat[].AttachFileRefMacro(*)

Field macro expression that must return a file name or name pattern in Name mode, optionally with relative/absolute folder path, to find the file attachments

This expression can optionally also be used in Reference mode to prepare the extracted value in terms of content.

In the macro expression, you can use file variables like FilePath, FileName and FileBaseName, which refer to the JSON file. For example, @FileBaseName + ".pdf" can be used to reference a PDF file which has the same base name as the JSON file.