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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tfileInputJSON and XPATH

I have a JSON file that contains
{"ORDER":"250"}

I would like to parse JSON with the use of XPATH. I use tFileIputJSON and logRow. What I have to do so that "250" will be shown with tLogRow.
I don't know what I have to put inside 'Loop Xpath query' and 'Xpath query' ?
0683p000009MEHX.png
Labels (3)
11 Replies
Anonymous
Not applicable
Author

{"ORDER","250"} is not a json. Maybe you want to put {"ORDER":"250"}? If yes, you put just "/" in the 'Loop XPath query' and "ORDER" in 'XPath query'.
Lin LIN
Consultant BI/Talend
Synaltic Group
Anonymous
Not applicable
Author

It works but if I change JSON to
{"ORDER":{"seba":"250"}}

it doesn't work anymore, why so?
Anonymous
Not applicable
Author

Do you want to take "250" or "seba":"250"? If you want to take "250", you need to put "ORDER/seba" in "XPath query". Or "/Order" in "Loop XPath query" and "seba" in "XPath query".
Lin LIN
Consultant BI/Talend
Synaltic Group
Anonymous
Not applicable
Author

I would like to take {"seba":"250"}.
Anonymous
Not applicable
Author

If you want to take {"seba":"250"}, maybe you should use JsonPath. You put "$" in "Loop Json query" and "ORDER" in Json query.
Lin LIN
Consultant BI/Talend
Synaltic Group
Anonymous
Not applicable
Author

How should I get "seba":"250" ?
Anonymous
Not applicable
Author

I think you should use the component tReplace or you code in tJavaRow.
Lin LIN
Consultant BI/Talend
Synaltic Group
Anonymous
Not applicable
Author

So with XPATH I cannot get out {"seba":"250"} if my JSON file looks like {"ORDER":{"seba":"250"}} ? 
Anonymous
Not applicable
Author

No, you can't.
Lin LIN
Consultant BI/Talend
Synaltic Group