jsonpath function length() does not work

I want to determine the length of an json array with the length() function.
According to the knime documentation the jsonpath implementation is based on the Jayway library, whoch supports the length function.
I have the follwoing JSON array:


In a JSONPATH node I have applied the following JSONPATH Query:


When testing the above example with the Jayway JsonPath Evaluator at https://jsonpath.herokuapp.com
I get the expected result 3.

When using the same JSON path query in Knime, I get a missing value result.
Can you either check if this is a bug or give any advice on how to get the length of json arrays?

Thanks for your efforts in advance!

1 Like

Hi @guidocarls,

thanks for asking and welcome to the forum :slight_smile:
Looking into the code with one of our devs, it seems that this currently isn’t possible. We expect a list/array, though the length function returns a single integer. I have opened a feature request (internal reference: AP-18152) to look into this in more detail.

A workaround for now is extracting a list and ungrouping it, to then read off the row count using the Extract Table Dimension node.


Kind regards


You can also use the /Column Expressions to get the length of an array.

Cheers, Iris


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