Skip to main content

JSON Input

Description:

JSON input is a step in the Input Plugin for Process Studio Workflows. The JSON Input step plugin step can read relevant portions out of JSON structures dynamically f rom f ield values in the stream or parameters, referring to f iles or Urls. Secondly, users can also define f iles and urls as static values. The step outputs portions of the JSON structures as rows.

Known Limitation

When a JSON Input step is used as the first step in a workflow and a file is specified for reading JSON content, clicking Preview rows button may result in a Null Pointer Exception related to the input field, and the JSON file is not previewed as expected.

Configurations:

Field NameDescription
File Tab:Here you enter basic connection information for accessing a resource.
Step nameSpecify a unique name for the step.
This label identifies the step within the workflow and helps you reference it when debugging or linking steps.
Source is from a previous stepEnable checkbox to retrieve the source from a previously defined field.
Select fieldChoose the field containing the source file from a dropdown list.
Use field as file namesEnable checkbox if source is a filename.
Read source as URLEnable checkbox if source should be accessed as a URL
Do not pass field downstreamEnabling checkbox will not pass this field downstream. This improves performance and memory utilization with large JSON fields.
File or directorySpecify the location of the source if the source is not defined in a field
Regular expressionSpecify a regular expression. All filenames that match this regular expression are selected if a directory is specified
Exclude regular expressionSpecify a regular expression. All filenames that match this regular expression are excluded if a directory is specified
Button: Show filenameClick Button to display the file names selected.
Content Tab:Enables you to configure which data to collect.
Ignore empty fileEnable checkbox to skip empty files---when unchecked, instances of empty files causes the process to fail and stop
Do not raise an error if no filesEnable checkbox to avoid failure when there is no file to process. When unchecked the workflow to fails when there is no file to process.
Ignore missing pathWhen unchecked, causes the workflow to fail when the JSON path is missing---then checked, avoids failure when there is no JSON path
LimitSets a limit on the number of records generated from the step when set greater than zero
Include filename in outputAdds a string field with the filename in the result
Rownum in outputAdds an integer field with the row number in the result
Add files to result files nameIf checked, adds processed files to the result file list
Fields Tab:
JSON EditorSpecify the required JSON into the editor. Click Generate JSON Tree to parse the JSON and display in the Select Field Window, where you can select fields from complex JSON data and add them to the Field table.
Generate JSON TreeClick Generate JSON Tree to view the visual tree structure of complex JSON data. You can expand, collapse, search, and select fields.
Notes:
- The system does not save the provided JSON after you close this dialog.
- Clear the editor before adding new JSON data.
Select Field WindowThe window shows the tree structure of given JSON data. Select required fields from the structure and click Select to add fields in Field table to procced
The total number of selected fields appears at the bottom of the page as Selected Count: N. For example, Selected Count: 32

The window provides the following options:
- Search search: Enter the name of the field that you want to find in the Search box. The system highlights matching results in blue.
- Select All select all : Click to select all fields in the tree.
- Deselect All deselect all: Click to not select all fields in the tree.
- Expand All expand all : Click to expand all JSON branches.
- Collapse All expand all : Click to collaps all JSON branches.
- Select select : click to confirm the selection and update the fields table.

Field Selection Status Colors:
1. Standard: Indicates an unselected field, for example- location
2. New Selection: Indicates newly selected fields in purple, for example, id
3. Already Mapped: Indicates previously selected fields in green, for example, store
4. Search Match : Indicates fields that match the search in blue, for example, book

Example JSON (used in the tree):
{
"store":
{
"id": 101,
"location": "New York",
"inventory": [
{
"book" : "Dune",
"author": "Herbert"
}
]
}
}
Beautify JSONClick Beautify JSON to format JSON with indentation for better readability.
Minify JSONClick Minify JSON to compresses JSON into a single compact line.
Clear JSONClick Clear JSON to clear all JSON text from the editor.
Field table:Table shows the list of selected fields and their details, such as field name, path, type, and other related information.
Or
Specify the JSON field details to the table in following formats:
- Sanitized field name
(for example, store_inventory_0_book)
OR
- Full JSONPath
(for example, $.store.inventory[0].book)
NameSpecify the name for the output field.
AttributeSpecify the attribute to read
TypeSpecify the data type to convert to
FormatSpecify the format or conversion mask to use in the data type conversion
LengthSpecify the length of the output data type
PrecisionSpecify the precision of the output data type
CurrencySpecify the currency symbol to use during data type conversion
DecimalSpecify the numeric decimal symbol to use during data type conversion
GroupSpecify the numeric grouping symbol to use during data type conversion
Trim typeSpecify the type of trimming to use during data type conversion
RepeatChoose from (Y/N). Specify Y to Repeat the column value of the previous row if the column value is empty (null)
Additional output fields Tab:
Short filename fieldSpecify the field name for short filename.
Extension fieldSpecify the field name for filename extension.
Path fieldSpecify the field name for file path
Size fieldSpecify the the size of the file.
Is hidden fieldSpecify fromY/N. Y to hide field. Default is N
Last modification fieldSpecify the field name for the last modification.
Uri fieldSpecify the fieldname for Uri (e.g. file:///C:/temp/file.txt)
Root uri fieldSpecify the fieldname for Root Uri (e.g. file:///C:/)