Json parse subvalues

Five Stars

Json parse subvalues

Hello,

I am trying to parse the following json data:

{
    "clinical_trials": {
        "total": 1,
        "results": [
            {
                  "position": "Principal Investigator",
                  "title": "Combined Treatment With XYZ",
                  "study_phase": "Phase II",
                  "conditions": [
                           "AAAAA BBBBBB CCCCC"
                   ],
                   "start_date": "2018-06-08T00:00:00",
                   "status": "Recruiting"
           }
        ]
    }
}

 

The output for "conditions" looks like this:

 

tInputFileJson

tFileInputJSON.JPG

 

tExtractJson:

tExtractJson.JPG

 

Here's the tInputFileJson component

Job_tFileInputJSON.JPG

 

Here's the tExtract component:

Job_tExtractJson.JPG

 

I have tried all sorts of variations on "conditions[*]" and so on but they either produce null or the data with the square brackets and quotes round it.

 

To be clear, there can be more than one value in the field.

 

Hope you can help.

Many thanks,

Bob.

Tags (1)

Accepted Solutions
Eleven Stars

Re: Json parse subvalues

TalendImage.JPGTalendImage1.JPGTalendImage2.JPGTalendImage3.JPG

 

Output 

 

[statistics] connected
1|Principal Investigator|AAAAA BBBBBB CCCCC
1|Principal Investigator|AAAAA BBBBBB CCCCD
[statistics] disconnected

Regards
Abhishek KUMAR

View solution in original post

Highlighted
Five Stars

Re: Json parse subvalues

Perfect!

Thank you.

View solution in original post


All Replies
Eleven Stars

Re: Json parse subvalues

TalendImage.JPGTalendImage1.JPGTalendImage2.JPGTalendImage3.JPG

 

Output 

 

[statistics] connected
1|Principal Investigator|AAAAA BBBBBB CCCCC
1|Principal Investigator|AAAAA BBBBBB CCCCD
[statistics] disconnected

Regards
Abhishek KUMAR

View solution in original post

Highlighted
Five Stars

Re: Json parse subvalues

Perfect!

Thank you.

View solution in original post

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog