Importing JSON Files

JSON file format is an open-standard file format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types.

Creating a JSON Import Job

To create an import job from a JSON file:

  1. Click the + (plus) button and select I mport Job or right-click in the browser and select Create new > Import job.
  2. Click Select Connections, select the connection and click Select, then select the the JSON file type and click Next. (Click New Connection to add a new connection if needed.)

  3. Enter the file or folder location. Wildcard characters are supported in the file path. 
    Import filters are supported by both date/time and file modification day.
    Set any desired advanced settings. (see below)
    Click Next.


    Advanced settings:
    The advanced settings give you additional customizable controls when importing JSON files.
    • Select the character encoding type.
    • Define how many records Datameer X should read to detect the column type.
    • Define the root path for where parsing should begin.
    • Define the object properties depth for which your JSON file is parsed.
    • Define JSON paths so a field is always created for them.
    • Define JSON paths that don't need to be expanded.
    • Define JSON paths that can be ignored and don't need to be imported.
    • Select if you want an "Additional Fields" column to be added to store extra fields as a JSONArray.
    • Select if you want to include the root JSON array when searching the records during import.
    • Select if you want to ignore the text before and and after the JSON object. 
    • Enter columns you want to have obfuscated upon import.


  4. View a sample of the data set to confirm this is the JSON data source you want to use. Use the checkboxes to select which fields to import into Datameer. Click Next.
  5. Define the schedule details, select whether to replace or append data, and click Next. (See Configuring Workbook Settings for information on the schedule details. If you append data with a sliding window, define when the window expires and how many results to keep.)
  6. Add a description, name the file, click the checkbox to start the import immediately if desired, and click Save. You can also specify notification emails to be sent for error messages received and when a job has successfully run.


Example

The JSON file is within an array

If your JSON data is located within an array, the import to Datameer X can't be read without configuring an advanced setting .

JSON data within an array
[
	{
 		"fruit": "Apple",
 		"size": "Large",
 		"color": "Red"
 	}
]

Without changing the advanced import settings in Datameer X when trying to parse this data, you receive the error:

Can not parse input: Could not read any raw record from: <your file>

Datameer X supports parsing JSON data from within an root array by selecting the Include root array checkbox.