# 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.

## **Getting XML/JSON Source Object**

1. To get an *XML/JSON File Source* 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://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FTfUedzWsiEjZCWeErc5W%2F0.png?alt=media)

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

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FUoziWcuhNsCLYJGBGkm9%2F1.png?alt=media)

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://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FQWyivoPjnpOecIHXkkSl%2F2.png?alt=media)

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

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FsyROgEVsZDSOqc0DF8UF%2F3.png?alt=media)

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://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FC2Nk5OGft7qnhE9fuYxl%2F4.png?alt=media)

* 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.

{% hint style="info" %}
**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.
{% endhint %}

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FB8DVn1HflSLE7KCXLMaM%2F5.png?alt=media)

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

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FDCWreR3XNOXy4eVEMlpG%2F6.png?alt=media)

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

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2F64zbmO2yQyv0PYvIK8n5%2F7.png?alt=media)

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://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FfiqZtmX0BXmNCtcoMoIs%2F8.png?alt=media)

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

![](https://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FXZ5Aw1WezHVA1VEePHtz%2F9.png?alt=media)

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://627607815-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6xzBT0roYJkfVS5klkLl%2Fuploads%2FJBL5RdSL5y9zdoGR8fBb%2F10.png?alt=media)
