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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
aaronrums
Contributor II
Contributor II

Use tFileInputJSON to output one record per object in a JSONArray of objects

Hello! As the title says, I want to use tFileInputJSON to output 1 record per object, when the json file is structured as in the attached example file.  

To be clear, want to have one record PER object in the array, so in the case of the attached file, it would be three rows, and each row would only have a 1 column, which would be the entire JSON object as a string. 

I cannot hardcode the column names, because they are not the same for every execution - I will extract the columns names using custom java code later on. 

I have attached a screenshot of the component setup right now. I've tried lots of small variations on what you see in the screenshot, including toggling the "use loop node as root".

Thank you!

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

Set the Json query as below:

"@"

0695b00000sPTKmAAO.pngIs this the output string you expect?

Starting job J11 at 16:07 21/11/2023.

[statistics] connecting to socket on port 3480

[statistics] connected

{"FirstName":"Bob","LastName":"Doe"}

{"FirstName":"Frank","LastName":"Doe"}

{"FirstName":"John","LastName":"Doe"}

[statistics] disconnected

 

Job J11 ended at 16:07 21/11/2023. [Exit code = 0]

 

Regards

Shong

 

View solution in original post

3 Replies
Anonymous
Not applicable

Hi

Set the Json query as below:

"@"

0695b00000sPTKmAAO.pngIs this the output string you expect?

Starting job J11 at 16:07 21/11/2023.

[statistics] connecting to socket on port 3480

[statistics] connected

{"FirstName":"Bob","LastName":"Doe"}

{"FirstName":"Frank","LastName":"Doe"}

{"FirstName":"John","LastName":"Doe"}

[statistics] disconnected

 

Job J11 ended at 16:07 21/11/2023. [Exit code = 0]

 

Regards

Shong

 

aaronrums
Contributor II
Contributor II
Author

yes, perfect! I did not know about the "@" character in the json path syntax. Thank you!

Anonymous
Not applicable

Great, thanks for your feedback!