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 Name | Description |
|---|---|
| File Tab: | Here you enter basic connection information for accessing a resource. |
| Step name | Specify 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 step | Enable checkbox to retrieve the source from a previously defined field. |
| Select field | Choose the field containing the source file from a dropdown list. |
| Use field as file names | Enable checkbox if source is a filename. |
| Read source as URL | Enable checkbox if source should be accessed as a URL |
| Do not pass field downstream | Enabling checkbox will not pass this field downstream. This improves performance and memory utilization with large JSON fields. |
| File or directory | Specify the location of the source if the source is not defined in a field |
| Regular expression | Specify a regular expression. All filenames that match this regular expression are selected if a directory is specified |
| Exclude regular expression | Specify a regular expression. All filenames that match this regular expression are excluded if a directory is specified |
| Button: Show filename | Click Button to display the file names selected. |
| Content Tab: | Enables you to configure which data to collect. |
| Ignore empty file | Enable 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 files | Enable 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 path | When unchecked, causes the workflow to fail when the JSON path is missing---then checked, avoids failure when there is no JSON path |
| Limit | Sets a limit on the number of records generated from the step when set greater than zero |
| Include filename in output | Adds a string field with the filename in the result |
| Rownum in output | Adds an integer field with the row number in the result |
| Add files to result files name | If checked, adds processed files to the result file list |
| Fields Tab: | |
| JSON Editor | Specify 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 Tree | Click 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 Window | The 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 - Select All - Deselect All - Expand All - Collapse All - Select 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 JSON | Click Beautify JSON to format JSON with indentation for better readability. |
| Minify JSON | Click Minify JSON to compresses JSON into a single compact line. |
| Clear JSON | Click 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) |
| Name | Specify the name for the output field. |
| Attribute | Specify the attribute to read |
| Type | Specify the data type to convert to |
| Format | Specify the format or conversion mask to use in the data type conversion |
| Length | Specify the length of the output data type |
| Precision | Specify the precision of the output data type |
| Currency | Specify the currency symbol to use during data type conversion |
| Decimal | Specify the numeric decimal symbol to use during data type conversion |
| Group | Specify the numeric grouping symbol to use during data type conversion |
| Trim type | Specify the type of trimming to use during data type conversion |
| Repeat | Choose 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 field | Specify the field name for short filename. |
| Extension field | Specify the field name for filename extension. |
| Path field | Specify the field name for file path |
| Size field | Specify the the size of the file. |
| Is hidden field | Specify fromY/N. Y to hide field. Default is N |
| Last modification field | Specify the field name for the last modification. |
| Uri field | Specify the fieldname for Uri (e.g. file:///C:/temp/file.txt) |
| Root uri field | Specify the fieldname for Root Uri (e.g. file:///C:/) |