JSON dynamic array search

@Brotfahrer I built a demo workflow to show how you might approach this issue.

The key might be to use dynamic searches for certain values in the XML/JSON file and then continue the extraction. KNIME also offers nodes to sort of automatically extract JSON structures but they might run quite long and maybe produce results that can be hard to interpret.

OK so first you search for the cell and the path where your desired object “VGSNAG3” might be found. JSON Path should offer a broaf variety of search options. Unfortunately the sampel syntax with KNIME does not cover them to soem depth and I was not instantly able to adapt more complex search algorithms from other web sites.

$['VehicleReport'][*]['Component'][*]['ECUShortName']['text']

You allow the search structure some flexibility. The art is later to only keep the information you want. You can extract precise values of cells, paths to later reuse or collection of these objects that would appear as lists (and you might later have to ungroup etc.).

Not: you also extract the sub-JSON block that would belong to the “ECUShortNames” as -well_ another JSON block you could deal with later.

Then you keep only those lines that have your ID “VGSNAG3”.

Then you can now approach your second (or more) JSON (sub-)object and extract the specific infgormation you want from the (presumably) ECUShortNames-block. These again can be single texts or lists or gaian nested onjects. Here you might try your hand at the other JSON nodes.

In the end you have the results in a table

This does just demonstrate some elements you might have to combine and some paths to explore:

1 Like