Configuring tExtractJSONFields looping input - 7.3

Extracting data from a JSON file through looping

EnrichVersion
Cloud
7.3
EnrichPlatform
Talend Studio
task

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.