About the CSV Data Format

Oracle Intelligent Track and Trace accepts transaction documents in CSV format and provides a predefined template for CSV documents, which you can download from the application.

If you are not familiar with JSON schema, you can use a pre-defined csv template to create and upload a csv transaction document for a step of a business flow. The CSV file can either be a comma separated file, which supports the US and UK format or a semi-colon separated file, which supports the European format specifically Germany, France, Italy, and Czech Republic.

Example of a Document in CSV Format

Apply the following rules and format when you create a document in CSV format:

Rows

  • The first row, header row, is mandatory and must be always present in the CSV file. It lists (in a flattened format) all possible fields from the document schema.
  • The second row, hint row, is optional. It doesn't need to be necessarily present in the uploaded CSV file. This row is only for informational purpose for the user to define what data type is expected.
  • Remaining rows are dedicated for the data itself.

Columns

  • The first column is a special column, containing record identifier(s). The Document can span over multiple CSV rows, that is necessary for arrays. Number of rows over which the document spans is dictated by this column. Value of cells in this column have no restrictions. Parser reads the CSV file row by row. If it encounters an unique record identifier, all rows, which have the same (or none) record identifier, belong to the currently processed document.
  • All other columns correspond to properties from document type schema.

Header Row

  • The first column is called record identifier
  • Remaining columns are generated using the following algorithm:
    • If the field type is an object, all inner properties are flattened using / (forward slash).
    • If the field type is an array of primitive types, the field name is used, which can be nested in an object.
    • If the field type is array of objects, <arrayFieldName>/<innerObjectName> notation is used, objects having nested properties are supported and follow the generic rule for objects.
    • For all other field types, the field name is used.

Hint Row

The cells represent the <dataType>. If the data type is an array of primitives, list[<primitive Type>] is used. If it's an array of simple objects, list[object(<fieldFromObject>)] is used. If the hint row is present, the first column, which is a record identifier for a row, must be empty.

Data Validation

Users will represent null values by leaving the corresponding cells empty.

Not Supported JSON Schema Draft 7 Constructs

The CSV format does not support the following JSON constructs of the document variant schema.

Note: Document type variants that violate one or more of the rules cannot support CSV data upload and therefore the UI will not show an option to upload in CSV format.
  • allOf
  • anyOf
  • oneOf
  • not
  • if
  • then
  • else
  • array in type field (allowed only single nullable types), e.g. type: ["string", "integer"] is forbidden
  • arrays inside arrays

The CSV files gets translated to JSON documents.

Processing of the uploaded CSV file is not transactional. If one of the records in the uploaded CSV file is incorrect due to the record rows not being converted to JSON or the JSON validation fails, the processing of the remaining records won't be affected.

The sample CSV files get translated to the following JSON documents:

JSON Document 1


                {
                    "result": {
                        "orderNumber": "X118566",
                        "orderDate": 1614955385,
                        "currencyCode": "GBP",
                        "orderLine": [
                            {
                                "itemNumber": 1,
                                "quantity": 5,
                                "itemDescription": "LAPTOP"
                            },
                            {
                                "itemNumber": 2,
                                "quantity": 3,
                                "itemDescription": "MOUSE"
                            }
                        ]
                    }
                }
            

JSON Document 2


                {
                    "result": {
                        "orderNumber": "X118566",
                        "orderDate": 1614955385,
                        "currencyCode": "GBP",
                        "orderLine": [
                            {
                                "itemNumber": 1,
                                "quantity": 5,
                                "itemDescription": "LAPTOP"
                            },
                            {
                                "itemNumber": 2,
                                "quantity": 3,
                                "itemDescription": "MOUSE"
                            }
                        ]
                    }
                }