Spectre Flow JSON Input Object
The Spectre Flow JSON Input object brings JSON formatted data into the build script. It accepts input from a .json file.
The JSON Input object has three sections in the properties panel where you set attributes.
You set attributes for the JSON Input object in the
object attributes section.
| Attribute | Description |
|---|---|
| File | Defines a json file as a data source. For information about the flow script tag, see file. |
| ID Column |
Defines a column where each row is the name of a field in a JSON object. For example, given the following input: Copy
Set ID Column as "Abbrev". The Abbrev column has the values CA, TX, and FL. For information about the flow script tag, see id-column. NOTE: When using the Include Other Columns attribute, the default behavior for object parent values is to create a column named ID for the field names. You can use the Drop ID attribute to avoid creating that column. |
| Drop ID | When the Parent attribute is an object and the Include Other Columns attribute is true, this prevents the creation of an ID column for the field names. For information about the flow script tag, see drop-id. |
| Parent | If a parent exists, this attribute specifies a JSON path that identifies where the parent value can be found in the document. The parent is the object that contains the values that will be mapped to rows. The parent value must be an object or an array. If parent is absent, the root of the JSON document is used as the parent. For information about the flow script tag, see parent. |
| Include Other Columns | If true, any columns found in the input that are not specified are included. For information about the flow script tag, see include-other-columns. |
| Limit Rows | Sets the number of rows to input. Any existing rows after the specified number are not processed. Optional. For information about the flow script tag, see limit-rows. |
| Prefix | Sets a string to add to the beginning of the names of all columns from this input. Optional. For information about the flow script tag, see prefix. |
| Similar Values Warning | If true, you are warned when the input data has multiple similar values in the same column. If false, this warning is suppressed. |
| Date Range Warning | If true, you are warned when the year of a date value is earlier than 1900 or later than 2199. If false, this warning is suppressed. |
| Current Date | Specifies the current day for time-series calculations and Analysis Tables. The value of this attribute must follow the default DI date formatting of "YYYY/MM/DD". It is DI best practice to pass a parameter with the current date value to this attribute rather than writing the value directly in the attribute. The default current date is today(). |
| Date Dimension | Specifies the name of the date dimension. This dimension is used in time-series calculations and Analysis Tables. |
| Extract Timestamp | Defines a timestamp value for later use in ProDiver. The timestamp value is accessed in ProDiver using the $EXTRACT_DATE and $EXTRACT_TIME macros. It is DI best practice to pass a parameter with the extract timestamp value to this attribute rather than writing the value directly in the attribute. |
To access column properties, select a column from the Column List. The following attributes are common column attributes. For a list of all column attributes, including attributes specific to certain data types, see Spectre Flow Column Tags.
| Attribute | Description |
|---|---|
| Name | Read only attribute displaying the name of the column. |
| Type | Specifies the data type of the column. Available data types are string, integer, double, fixed100, date, datetime, period, and boolean. |
| Sort By | Defines another column to sort by when this column is sorted. For example, setting Month Number as the Sort By column for Month sorts months by their number instead of their alphabetical order (1 (Jan), 2 (Feb), 3 (Mar), etc.). |
| Label | Defines a display name for a column. This name is displayed in ProDiver and DivePort, while calculations and other technical processes use the value in the Name attribute. |
| Required Dimension |
Sets a column to behave like a classic Info Field. In ProDiver, the info field is available as a column that you can add to other columns displayed in a dive. For example, to see the Address column requires that the Customer column is available.
|
| Suggested Dimension |
Allows you to promote or demote a column.
|
| Comment | Defines a comment that describes this column. |
Each object has an area where you can enter comments. It is DI best practice to enter a note for every object in a Spectre Flow script.
Every Spectre Flow node comment area is Markdown-enabled. For more information, see Workbench Markdown Editor.
The JSON Input object
column grid section lists the columns from the input files.
| Attribute | Description |
|---|---|
| Name | Displays the name of each input column. This attribute is read-only. |
| Alias | Defines an alternate name for one or more input columns. Spaces before or after an alias column name are ignored. Spaces within an alias column name are acceptable. |
| Type | Displays the type of each input column. This attribute is read-only. |
| Keep |
Manages which columns are kept in the output data flow. If no columns have a Keep check mark, all columns are kept in the output data flow, except for any explicitly marked Drop. Select the Keep check box for columns you want to explicitly keep in the output data flow. A number is automatically added in the Keep Order column when you select its Keep check box. After marking any column with a Keep check mark, only those marked Keep are kept in the output data flow. NOTE: After any Keep check boxes are checked, do not use the Drop check boxes, because clicking a Drop check box sets all Keep check boxes to unchecked. |
| Keep Order | Manages the order of the columns in the output data flow. By default, columns that are passed to the next object in the data flow are displayed in the order in which they appear in the Name column. You can change this order by typing a number in the Keep Order column. When you assign a Keep Order number, the Keep column is checked automatically. The Keep Order numbers might reorder to accommodate any changes you make. |
| Drop |
Manages which columns are removed from the output data flow. Select the Drop check box for columns that you want to explicitly suppress from the output data flow. NOTE: Use the Drop check boxes only when no Keep check boxes are checked. |