tFileInputJSON Use Case-Parse JSON using Talend

tFileInputJSON extracts JSON data from a file according to the JSONPath query, then transferring the data to a file, a database table.

tFileInputJSON  Use Case : This post I will demonstrate you, how to parse JSON File using Talend.  Below is our sample JSON File.

{ "Person": { "firstName": "John", "lastName": "Smith", "age": 25, "Address": { "streetAddress":"21 2nd Street", "city":"New York", "state":"NY", "postalCode":"10021" }, "PhoneNumbers": { "home":"212 555-1234", "fax":"646 555-4567" } } }

You can download sample file here.

Step 1: Click On Json node from metadata tree view. then provide file name and file which will show you below schema from given JSON.

 tFileInputJson-Create Metadata for JSON
tFileInputJson-Create Metadata for JSON

Step 2: Click on Next. On Next window you need to map desired field from JSON. See the picture below.

tFileInputJson-Metadata field Map, For Extraction

tFileInputJson-Metadata field Map, For Extraction

Below table we have Schema fields and Xpath Mapping.

Absolute Xpath Expression /Person/Address
firstName “../firstName”
lastName “../lastName”
age “../age”
streetAddress “streetAddress”
city “city”
state “state”
postalCode “postalCode”
home “../PhoneNumbers/home”
fax “../PhoneNumbers/fax”

Now we have our input ready, so we can parse it.

Step 3: Drag and drop newly created metadata from JSON, and select tFileInputJson from drop options. See in below picture.


tFileInputJs- Select component.
tFileInputJs- Select component.









Step 4: Add tLogRow component after tFileInputJSON component and connect it with Main connection, then run the job you will see below output.

tFileInputJson sample job with output

tFileInputJson sample job with output







About dwetl

One thought on “tFileInputJSON Use Case-Parse JSON using Talend

  1. Hi,

    I have a complex JSON array data and I couldnt parse either in tExtractJSONFile or tFileInputJson as pe r above steps.

    Please do reply so I will connect with you and explain exactly what I am facing issue.


Leave a Reply

Your email address will not be published. Required fields are marked *