Skip to content

#length

Returns the length of a string or array value.

#length(value)
Category Strings and arraysValid in Property value
Name Type Description
value path | string | array The string or array to measure.

integer

source.json
{
"text": "hello",
"items": [ 1, 2, 3 ]
}
transformer.json
{
"textLength": "#length($.text)",
"itemCount": "#valueOf($.items)->#length()"
}
output.json
{
"textLength": 5,
"itemCount": 3
}

Try it in the playground →

#isEmpty · #any