I am working on a test JSON file and have encountered some issues. Column data is not aligning correctly. For example row 36, column 9 is saying RESPONSIBLE_PERSON, when reviewing the JSON data this is incorrect for this particular row. I am not sure whether there is a step I am missing here, any help would be appreciated.
I was seeing the responsible person under the actual responsible person in row 18, I made an assumption which was not a good idea considering this is just a test file.
Correct. Although I did have a question which maybe you can help me with.
When I am selecting the Person tracking ID I am using the âAdd Collection Queryâ option to display the data correctly, however, when it comes to the address fields I am having to use the âAdd Single Queryâ option to display this data correctly. It is a little confusing to me.
Thanks for all your help on this, it was good to have a second set of eyes look at this.
âThe result of a simple query (also called definite JSONPath) is a single value. The result of a collection query (also called indefinite JSONPath) is a list of multiple values.â
Basically, imagine that (for each record ie each line) you have multiple âpersonTrackingNumberâ, it will be nested and to retrieve that in Json you should use :
By using âAdd collection queryâ, Knime will use $[âcoveredInsuredMembersâ][*][âpersonTrackingNumberâ] and will concat all âpersonTrackingNumberâ (ie record [0] recor [1] etcâŚ) as a list in a column.
So to use it correctly, when you use the option :
Add single query, the column is populated with one âdataâ (notice that the list column is not checked)
Add collection query, the column is populated with a list (that you should âungroupâ as multiple columns or so, and the list column is checked)
So in most of the case you should use âAdd single queryâ, unless you have multiple records, then you should use a collection.
Thanks Samir! This is a great explanation. Although this is not directly the answer to the initial question I am going to mark this as the answer as I think this will be the most useful info to others.