Configuring tExtractJSONFields looping input - 6.5

JSON

author
Talend Documentation Team
EnrichVersion
6.5
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance > Third-party systems > File components (Integration) > JSON components
Data Quality and Preparation > Third-party systems > File components (Integration) > JSON components
Design and Development > Third-party systems > File components (Integration) > JSON components
EnrichPlatform
Talend Studio

About this task

This task assumes that you know the structure of the JSON file.

Procedure

  1. In the Basic settings view of the tFileInputJSON component, select JsonPath from the Read By drop-down list.
  2. In the filename field, specified the input JSON file, sample.json in this example.
  3. In the schema editor, add two columns, Guid (type String) and Transactions (type Object).
  4. Click Yes in the subsequent dialog box to propagate the schema to the next component.
    The columns just added appear in the Mapping table of the Basic settings view.
  5. In the Basic settings view, enter "$" in the Loop Json query text box to loop the elements within the root elements.
  6. In the Json query column of the Mapping table, enter the following Json query expressions in double quotation marks.
    • $.Guid to extract the value of the Guid element;
    • $.Transactions to extract the content of the Transactions element.