How to iterate through a json file to get the list of values corresponding to the each field

I had used JSON path to get list of elements related to file_name(JSON field). PFA Json file for reference.
Any suggestions will be really helpful to get the expected output from the attached JSON file.


sample_knime.json (844 Bytes) output_expected

Can you clarify what’s the actual problem you are having with the workflow in the screenshot you posted?

2 Likes

Hi @elsamuel

My understanding is on JSON Path node is we can’t loop through the JSON Array for each iteration. If there is any way we can iterate the JSON Array of JSON object in JSON path it will be helpful to achieve my expected output.
json_read.knwf (21.7 KB)
PFA workflow used to read the json file. output of ungroup node is like below.

I need help on getting output similar to
https://forum.knime.com/uploads/default/original/3X/4/7/47c5944019f20d454041ce5f4ae611eea25b4987.png.

I need to create a table with field_name with it’s corresponding file name, datatype and metatype. By using the attached json file i need to get output as mentioned above, any suggestions will be helpful

Here’s what I’ve come up with that gives the desired output:

The basic idea is to work through the JSON file in stages. Hopefully this works when applied to a longer JSON file.

2 Likes

Hi @elsamuel It worked and got to know what I missed in my implementation.
Thanks you for sharing the WF, learnt few :slight_smile:

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.