Generic JSON Import Simple Example

The following is an example of an import document and template that uses most of the features present in a Generic JSON template. This example uses the Import Manager, but Inbound Integration Endpoints can also be configured with the same input and template.

Input Document

Copy the following text to a new file and save it as a JSON file. Open the Import Manager and select the file as the Data Source Filename and click 'Next.'

Copy
{
  "Products": [
      {
        "Name": "Pilot Pen",
        "Markets": [
          {
            "MarketID": "USA",
            "Priority": "Low",
            "Attributes": [
                 {
                    "AttributeID": "42",
                    "UnitID": "Pounds",
                    "Value": 3.068
                 },
                 {
                    "AttributeID": "84",
                    "UnitID": "Dollars",
                    "Value": 12.499
                  }            
              ]
           },
           {
            "MarketID": "EU",
            "Priority": "High",
            "Attributes": [
                 {
                    "AttributeID": "42",
                    "UnitID": "Kg",
                    "Value": 1534
                 },
                 {
                    "AttributeID": "84",
                    "UnitID": "Euro",
                    "Value": 22.995
                 }            
              ]
            }
        ],
        "Colors": [
            "Red",
            "Green",
            "Blue"
          ]
      },
      {
        "Name": "Parker Pen",
        "Markets": [
          {
            "MarketID": "USA",
            "Priority": "Low",
            "Attributes": [
                 {
                    "AttributeID": "42",
                    "UnitID": "Pounds",
                    "Value": 3.728
                 },
                 {
                    "AttributeID": "1864",
                    "UnitID": "Dollars",
                    "Value": 12.499
                 }            
              ]
            },
         {
            "MarketID": "EU",
            "Priority": "Extreme",
            "Attributes": [
                 {
                    "AttributeID": "42",
                    "UnitID": "Kg",
                    "Value": 1534
                 },
                 {
                    "AttributeID": "84",
                    "UnitID": "Euro",
                    "Value": 22.995
                 }            
              ]
            }
        ],
        "Colors": [
            "Gold",
            "Silver"
          ]
      }
    ]
}

Template

Copy the following text and paste it in the Import Manager Select Format step (refer to the image in the Conversion Preview section below), Sample field.

Copy
{
  "Products": [
      {
        "[?Instruction?]": "[?Record?]",
        "Name": "[?Source?]",
        "Markets": [
          {
            "[?Instruction?]": "[?Repeated?]",
            "MarketID": "[?SourceID?]",
            "Priority": "[?Source?]",
            "Attributes": [
                 {
                    "AttributeID": "[?MultiSource?]",
                    "UnitID": "[?MultiSource?]",
                    "Value": "[?MultiSource?]"
                 }         
              ]
            }
        ],
        "Colors": "[?MultiSource?]"
      }
    ]
}

Conversion Preview

Click the Sample reload button . The Conversion Preview area displays the results of the input document against the provided template.

The Map Data step (defined in the Inbound Map Data - Map topic) presents the Generic JSON data for further mapping, if necessary, as well as transformations. To learn more about inbound transformations, refer to the Inbound Map Data - Transform topic.