Multi Level Json

Eight Stars

Multi Level Json

I have a JSON object with following structure (sample). As far as I can see, there are three levels...

  • Parent
    • Child
      • Grand-Child

What will be the best way to consume this and maintain a parent-child-grand-child relationship in a table? I am not able to see good documentation on tExtractJSONFields/ tFileInputJson.

 

Any pointers appreciated.

 

{
    "categories": [{
        "id": "P1",
        "name": "P1",
        "path": "P1",
        "children": [{
            "id": "P1_C1",
            "name": "P1_C1",
            "path": "P1_C1",
            "children": [{
                "id": "P1_C1_xC1",
                "name": "P1_C1_xC1",
                "path": "P1_C1_xC1"
            }, {
                "id": "P1_C1_xC2",
                "name": "P1_C1_xC2",
                "path": "P1_C1_xC2"
            }]
        }]
	}]
}	
Community Manager

Re: Multi Level Json

Hi
Using 'Xpath' model and set the xpath loop expression to:
/categories/children/children
You should be able to read parent-child-grand-child data.

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Download