Skip to main content

Extracting JSON data from a file using JSONPath without setting a loop node

This scenario describes a two-component Job that extracts data from the JSON file Store.json by specifying the complete JSON path for each node of interest and displays the flat data extracted on the console.

For more technologies supported by Talend, see Talend components.

The JSON file Store.json contains information about a department store and the content of the file is as follows:

{"store": {
    "name": "Sunshine Department Store",
    "address": "Wangfujing Street",
    "goods": {
        "book": [
            {
                "category": "Reference",
                "title": "Sayings of the Century",
                "author": "Nigel Rees",
                "price": 8.88
            },
            {
                "category": "Fiction",
                "title": "Sword of Honour",
                "author": "Evelyn Waugh",
                "price": 12.66
            }
        ],
        "bicycle": {
            "type": "GIANT OCR2600",
            "color": "White",
            "price": 276
        }
    }
}}

In the following example, we will extract the store name, the store address, and the bicycle information from this file.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!