Skip to main content
Announcements
A fresh, new look for the Data Integration & Quality forums and navigation! Read more about what's changed.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Getting JSON fields from JSON array with XPATH

My JSON looks like this
{
"ORDER": ,
"HELP_NR": "554-5774"
}

How can I get fields out from JSON with XPATH ? The problem is that the number of JSON elements varies. Sometimes is 3, Sometimes is 4 and Sometimes is 2?
So JSON sometimes look like this:
{
"ORDER": ,
"HELP_NR": "554-5774"
}

My job looks like this:
tFileInputJSON -- tLogRow
I would like my tLogRow to look like this:
.--------------------.
|     tLogRow_2      |
|=------------------=|
|Name                |
|=------------------=|
|Mike|
'--------------------'
|Linda|
'--------------------'
|Danny|
'--------------------'
Labels (3)
3 Replies
Anonymous
Not applicable
Author

Hi sebast
I sent the solution
Please look at the snapshot's.
0683p000009MENP.png 0683p000009MENU.png 
Best regards,
Alfonso Borre
skype : alfonso.borre
Anonymous
Not applicable
Author

I tested and it works. This is just what I need for now. Thanx. 
Anonymous
Not applicable
Author

I added new JSON object which has array of objects. So my new JSON looks this:
{
    "ORDER": ,
    "HELP_NR": "554-5774",
    "TEAM":
}

I wonder how can I get "NAME_T" values as well?
I was able to get this out, and it is not quite what I wanted:
.-----+--------+------.
|      tLogRow_1      |
|=----+--------+-----=|
|NAME |HELP_NR |NAME_T|
|=----+--------+-----=|
|Mike |554-5774|      |
|Linda|554-5774|      |
'-----+--------+------'

I would like that under "NAME_T" would be 'Orange' and 'Pink'.
And on the picture you can see the settings in the tFileInputJSON:
0683p000009MEKW.png
How can I do that ?