Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Zurich on Sept 24th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tExtractJSON when there are no value names

Hi All,

I have been using the tExtractJSONFields component to parse json objects from a tRESTClient component successfully to date.
However, i am now looking to parse using another endpoint where the json format is slightly unusual...


{

    "tags": [
        "english",
        "zopim_chat",
        "hostelbookerscom",
        "zopim_chat_ended"
    ]

}



What i want is for the above to return 4 records with just the value.  Were these values pairs i.e. "value": "english" this wouldnt be a problem, but i dont know how to refer to each itme  within tags without the value name...

The closest i have gotten so far is to setup the tRESTClient and tExtractJSONFields components as illustrated in the following screenshots:


0683p000009MFWY.png0683p000009MFV6.png0683p000009MFay.png0683p000009MFb3.png

The last screenshots shows the results, which are far from what i want but this is the only setup that returns a value at all for me.  If i change any of the settings i end up with blank strings being returned or nulls.  Its become very frustrating...

Any and all advice welcomed!

Regards,
Scott

Labels (2)
2 Replies
Anonymous
Not applicable
Author

Hi 
Set the Xpath query as "." and uncheck the 'Get nodes' box, you should be able to extract each item of the array.

Regards
Shong
Anonymous
Not applicable
Author

i seem to have a similar problem.
i need to get the values: 10048,10123,10182,10183 (NOT from the 'sprints' array) etc... from velocityStatEntries but that is not an array, else i could loop thru the array with $.velocityStatEntries

but they stand alone in the JSON (see below), how can i get to them? i am currently using JSONpath to loop and get values like 'estimated' and 'completed'. but for the ID's i cannot find a way..
JSON source file:

{
"sprints": [{
"id": 10447,
"sequence": 10447,
"name": "SP120 - Plannibal Smith",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10391,
"sequence": 1 0391,
"name": "SP119 - Don't bug or bend over",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10244,
"sequence": 10244,
"name": "SP118 - Be an all grounder!",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10183,
"sequence": 10183,
"name": "SP117 - The R Factor",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10182,
"sequence": 10182,
"name": "SP116 - Deliverfull",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10123,
"sequence": 10123,
"name": "SP115 - Appartemenneke",
"state": "CLOSED",
"linkedPagesCount": 0
}, {
"id": 10048,
"sequence": 10048,
"name": "SP114 - two three letter words",
"state": "CLOSED",
"linkedPagesCount": 0
}],
"velocityStatEntries": {
"10048": {
"estimated": {
"value": 15.5,
"text": "15.5"
},
"completed": {
"value": 6.0,
"text": "6.0"
}
},
"10244": {
"estimated": {
"value": 15.5,
"text": "15.5"
},
"completed": {
"value": 7.5,
"text": "7.5"
}
},
"10182": {
"estimated": {
"value": 12.0,
"text": "12.0"
},
"completed": {
"value": 10.0,
"text": "10.0"
}
},
"10391": {
"estimated": {
"value": 16.0,
"text": "16.0"
},
"completed": {
"value": 3.0,
"text": "3.0"
}
},
"10183": {
"estimated": {
"value": 12.0,
"text": "12.0"
},
"completed": {
"value": 7.0,
"text": "7.0"
}
},
"10123": {
"estimated": {
"value": 11.5,
"text": "11.5"
},
"completed": {
"value": 5.5,
"text": "5.5"
}
},
"10447": {
"estimated": {
"value": 7.0,
"text": "7.0"
},
"completed": {
"value": 3.0,
"text": "3.0"
}
}
}
}



Expected output:

ID      | estimated | completed
__________________________
10048 | 15.5         | 6.0
10244 | 15.5         | 7.5
etc...

NOTE: NOT the ID from the 'sprints' array but just the number that has no name