# XML/JSON File Source

Adding an *XML/JSON File Source* object to a dataflow allows you to read and transfer data from an XML or a JSON file.

### Video

{% embed url="<https://www.youtube.com/watch?v=mWdoPPFjO0c>" %}

### Getting XML/JSON Source Object

In this section, we will cover how to get an *XML/JSON File Source* object on the dataflow designer from the Toolbox.

1. To get an *XML/JSON File Source* from from the Toolbox, go to *Toolbox > Sources > XML/JSON File Source*. If you are unable to see the Toolbox, go to *View > Toolbox* or press Ctrl + Alt + X.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FqQHzqIAhA7Zowr2WhOAr%2F1.png?alt=media\&token=d3f19cf8-ce12-47c0-bf80-43aa7a9b8786)

2. Drag-and-drop the *XML/JSON File Source* object onto the designer.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F1mYnKQ0SXKWHkxYfCcNr%2F2.png?alt=media\&token=5f0b0557-65f2-4868-9021-ef4f4a88c82c)

You can see that the dragged source object is empty right now. This is because we have not configured the object yet.

### Configuring the XML/JSON File Source Object

1. To configure the *XML/JSON File Source* object, right-click on the header and select *Properties* from the context menu.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F8p0HmEEjNBzVkS3XUKC2%2F3.png?alt=media\&token=6fc2f9d9-cfd3-4829-aac1-72f8c6073b3b)

When you select the *Properties* option from the context menu, a dialog box will open.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FNsUZMVQgSAzIoR53g77b%2F4.png?alt=media\&token=9d4e4848-550b-413b-87d6-e727c52bdda0)

This is where you can configure properties for the *XML/JSON File Source* object.

2. The first step is to provide the *File Path* and *Schema Location* for the *XML/JSON Source* object. By providing the file path and schema, you are building the connectivity to the source dataset.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F7i12Jf53O0Qi41FnkOlq%2F5.png?alt=media\&token=15ee9aa9-5c70-4409-b3f9-6fd366bd6192)

* Check the *JSON Format* checkbox if your source file is a JSON.
* Check the *Provide Inner XML* checkbox to get the XML markup representing only the child nodes of the parent node.

  **Note**: In this case we are going to be using an XML/JSON file with *Orders* sample data in the parent node and *Order Details* sample data in the child node.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fyx1TPp1hJBg2qIjtutVT%2F6.png?alt=media\&token=ac9ffaf6-5d1e-4523-9651-c4af073c06b8)

3. Once you have specified the data reading options in this window, click *Next*.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F0HERFPwgrrsG9ihMz3ew%2F7.png?alt=media\&token=18269038-a328-4157-938b-421e85a5139f)

On the *XML Layout* window, you can view the layout of your XML/JSON source file.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fi7knOl0yi3vP8esvAhs6%2F8.png?alt=media\&token=5f8d7356-248a-4cf2-b9c7-beb8fa681bef)

4. After you are done viewing the layout, click *Next*. You will be taken to a new window, *Config Parameters*. Here, you can define the parameters for the *XML/JSON File Source*.

Parameters can provide easier deployment of flows by eliminating hardcoded values and provide an easier way of changing multiple configurations with a simple value change.

{% hint style="info" %}
**Note**: Parameters left blank will use their default values assigned on the properties page.
{% endhint %}

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FaWzUs4P3IOA0S7SfUCBc%2F9.png?alt=media\&token=79a709f4-6678-4079-86d3-d6bd3436d19b)

5. After you have configured the source object, click *OK*.

![](https://docs.astera.com/projects/centerprise/en/10/_images/1012.png)

You have successfully configured your *XML/JSON File Source* object. The fields from the source object can now be mapped to other objects in a dataflow.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F0jhHMWzB3OQlx4w4x1KN%2F11.png?alt=media\&token=c9d5787b-e665-45fa-a3c3-53bcca246e23)
