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

{% embed url="<https://youtu.be/mWdoPPFjO0c?list=PLmyM3TZtVUyJbGUVFYsCL9JoAH_VxJTfh>" %}

### 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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2Fkjl4AzVmHTctDjOIa4Vb%2F1.png?alt=media\&token=8f48980c-75e4-4fa0-bf4f-443f583a5c76)

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

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FN2Gs0TUxA1nmRyqdU0tF%2F2.png?alt=media\&token=3566a703-8c1c-4d26-bc54-344871baed23)

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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2F16J3rsdC0VSFh2SrGPJR%2F3.png?alt=media\&token=780e7412-14ad-4765-b120-4f3cdbf9f11e)

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

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FXxh0KHOhsK0vHilDodj3%2F4.png?alt=media\&token=cace0f1f-a9ce-4818-b81f-227122c4e59f)

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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FbiLOAAOCPSntywCTT7mu%2F5.png?alt=media\&token=301c0fa2-42d7-4e11-8db1-1193b9bfefdd)

* 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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FxvYIQW28r8wR0XUJjY0c%2F6.png?alt=media\&token=73228d67-6ac7-48dc-9f99-2ab515201572)

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

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FUFwk7JbB1hdrqJxGdEph%2F7.png?alt=media\&token=218a17f4-6ec2-441e-b1db-fd2807efbc02)

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

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FWT6ZgjItVIEFrS4eaLyJ%2F8.png?alt=media\&token=3a89abf3-47ad-4562-91ff-4c54ee6628ca)

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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FMmRuCTQswntuGfMKUc0C%2F9.png?alt=media\&token=8e8836b6-a50f-4e6f-92d8-e0a84956cd54)

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

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FviPpgyBjFwSPEYKR06I0%2F10.png?alt=media\&token=9e6147db-dde2-4594-9c18-3d98bb3d8e7b)

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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FdyzOydOSgZvYxVRJX96N%2F11.png?alt=media\&token=ea963fd0-58d3-4671-a927-a0b0d46eb262)
