@fseck , @ArjenEX , knimers
Despite the topic is closed; I came up with this solution late yesterday, but i interpreted the challenge to make it work with ‘n’ output queries…
I want to extract certain information from a JSON file with Knime.
I already figured out which nodes to use:
now I am stuck at the correct JSON path.
The JSON structure has a repeating pattern for different outputs.
I would like to get for example the attribute 1 from ,general data" and the third value of attribute 1 from ,width" FOR EVERY OUTPUT.
I already can extract the information for a single output, but I don’t know how to get it for each.
Has anyone got an …
The current solution that I came up, is the lower branch in my workflow; but I couldn’t make it work with variables (upper branch). I’ve tested it with and without quota characters, scape bars…
Does anyone in forum actually knows how to configure variables for the ‘JSON Paths’ node? Thx in advance.
20221103_parse_json.knwf (98.7 KB)
It all depends on your configuration. Your path variable is correct but if you just the leave the upper JSON Path empty, you need to make almost all fields variable controlled to make it work since it’s mandatory information to have for the node.
Doing so, the path node will start working:
I took the settings from the lower node, outputted them as flow variable (
reference) and connected it to the upper to play around. This is the syntax of all flow variables that are used:
For the time being, I would just add those additional ones as constants in your metanode. For example with a CE. The groupBy already takes care of converting to list.
You should get all the required information pretty quickly afterwards. I would compare your metanode output with the flow variable from the lower path node (beforementioned image) and go from there.
Hope this helps!
I’ve learnt a very
handy hack about working with variables. This will facilitate my life dealing with complex variables from now on.
And the the compulsory uppermost ‘input.column’ variable, it was in fact the main reason why I couldn’t make it work. I couldn’t figure out by my own.
Keep in good shape. BR
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.