Introduction #
In this tutorial, you will learn how to import JSON files into Data Loader using both Flat and Hierarchical formats. Flat JSON files contain data with only one level, while Hierarchical JSON files have multiple levels of data. Our mapping will be handled using both data templates, and both formats utilize V3 processing.
In this tutorial, we are showing usecase with different JSON formats:
- Flat JSON
- Hierarchical JSON
1.How to import flat JSON file using the Data Loader. #
What is flat JSON?
Flat JSON in this context means a single level of elements wrapped in the root element with no other structuring
Pre-requisite: #
- Upload or Create Message Type.
- Create Integration.
- Create Inbound Interface.
- Do mapping.
Here are the steps to import a Flat JSON file with the Inbound Interface:
- If you have not yet configured CSP Trusted Sites and CORS, you will not be able to import hierarchical CSV, XML, and JSON files. An error message will be displayed as shown in the screenshot below.
Note: Before importing data, you need to create CORS and CSP Trusted Sites to enable the data loader to use the REST API for import files . If you have already completed this step, please ignore this reminder: Here is the link for creating https://docs.skyvva-dev.com/docs/the-configuration-enables-to-use-new-data-loader/
Step 1: Create a Metadata Provider and Repository
- Go to Metadata provider => create Repository => Upload or create Message Type.
- Here’s Message Type.
Step 2: Create Integration.
Step 3: Interface and linked with message type.
- Fill Name
- Select Delopyed Status
- Select Account Source Name
- Select Inbound Direction
- Select V3 Interface API Version
- Select MetaData Provider, Repository, and Source/Target Message Type
- Click Save Button
Step4: Do mapping.
Step 5: Step 5: Go to Integration -> Click the Details page -> Then click the Data Loader link on the Custom Section.
- Choosing Import Data Function.
- Select Interface and click next.
- Select Format Data Type and click next.
- Click Upload file to choose a file and click the upload button.
- Select record and click push button.
- Here’s the Payload
- Here’s the result on the message monitor.
2. How to import Hierarchical JSON using the Data Loader. #
What is the Hierarchical?
In a hierarchical Interface, one interface is a parent of other interfaces. It means that the child interfaces a relationship with a parent. For example, the Account interface is a parent of the contact.
Also, One parent interface can have many child accounts but the child interface has only a single parent interface. eg. one Account can store many Contacts, but one Contact can’t store many Accounts.
Pre-requisite: #
- Create or upload Message Type.
- Create Integration.
- Create Inbound Interface.
- Do mapping
Here are the steps to import a Hierarchical JSON file with the inbound interface:
Step 1: Create a Metadata Provider and Repository
- Create or upload Message Type.
- Here’s the message Type
Step 2: Create Integration
Step 3: Create Inbound Interface linked with the message type.
- Fill Name
- Select Delopyed Status
- Select Account Source Name
- Select Inbound Direction
- Select V3 Interface API Version
- Select MetaData Provider, Repository, and Source/Target Message Type
- Click Save Button
Step 4: Do mapping.
Step 5: Go to Integration -> Click the Details page -> Then click the Data Loader link on the Custom Section.
- Choosing Import Data Function.
- Select Interface and click next.
- Select Format Data Type and click next.
- Click Upload file to choose a file and click the upload button.
- Select record and click push button.
- Here’s the Payload.
- Here’s the result on the message monitor.
Summary #
Finally, we have learned about how to import JSON data using a data loader. We have understood the MessageType, create the Interface and data loader, and check the results on the message monitor.