Output Format "Json"
This output format generates a JSON file from the index data of the document. The file attachments of the document can be embedded, or references to file attachments to be carried externally can be generated.
Notice
Here, define the properties for the output values to be created in the JSON file in a proprietary syntax (see XPath Syntax). This syntax is based on the JSONPath syntax (see JSON index data reader), so this is what it is called below. Functionally, however, this syntax only has to do with JSON output format creation here, while JSONPath is actually a syntax for reading in existing JSON data.
Property | Description |
|---|---|
OutputFormat[].AttachFileMode | Mode determining how additional file attachments are added to the JSON file:
The physical availability of the files in the file system that are referenced in the |
OutputFormat[].ItemProperty[](*) | Subparameters for defining a JSON property for receiving tabular data If item data or other table data is output, configuration of this property is mandatory. The property must represent a JSON element of type "Array."
The In field mapping under |
OutputFormat[].AttachFileProperty(*) | Definition of a JSON property in JSONPath syntax under which the reference to file attachments or the binary data of file attachments are output This definition is required in the
To output multiple file attachments, the path defined in the To output a single file attachment, an elementary property can be defined in |
OutputFormat[].AttachFileRefMacro | Macro expression for formatting the file reference value in The default value is preset with the expression |
XPath Syntax
The properties of this output format use a restricted variant of the JSONPath syntax. This syntax consists of a path specification composed of the dot-separated property names of nested objects. The lowest property in the path takes the elementary target value. By default, the parent properties each represent an object.
If a property is to represent an array, indicate this with square brackets after the property name. For instance, you would need to do this for the properties .ItemProperty[] and .AttachFileProperty (i.e., for table rows and file attachments).
Other values can also be output to an array if required. In this case, specify the array element. A numeric value in the square brackets specifies a concrete element number, with counting starting at 1. A search key {name}={value} defines a search for an array element of the type "object" that contains a property with the specified name and value. Array elements that do not yet exist are automatically created, with the property for the search key also being set if necessary. Only the string type is supported as its value. If neither element number nor search key is specified, the first array element is always referenced and only created if the array is still empty.
The following examples show which JSON elements result, based on different JSONPath expressions:
Proprietary JSONPath expression | Generated JSON fragment |
|---|---|
| {
"Doc": {
"InvoiceNumber": …,
"InvoiceDate": …
}
} |
| {
"Fields": [
…,
…
]
} |
| {
"Fields": [
{
"Value": …
},{
"Value": …
}
]
} |
| {
"Fields": [
{
"Name": "InvoiceNumber",
"Value": …
},{
"Name": "InvoiceDate",
"Value": …
}
]
} |
The following excerpt illustrates the use of JSONPath syntax in the context of practical output format configuration:
{
"OutputFormat": [
{
"ItemProperty": [
"ItemProp: Document.Items[]"
],
"AttachFileProperty": "File: Document.Files[], Data: Reference, Name: Name"
"Field": [
{
"Name": "Field1",
"OutputName": "Document.Fields[Name=Field1].Value"
},{
"Name": "Items.Field1",
"OutputName": "Fields[Name=ItemsField1].Value"
}
]
}
]
}The following JSON data is generated from this configuration:
{
"Document": {
"Fields": [
{
"Name": "Field1",
"Value": …
}
],
"Items": [
{
"Fields": [
{
"Name": "ItemsField1",
"Value": …
}
]
}
],
"Files": [
{
"Reference": "…",
"Name": "…"
}
]
}
}