Does Apigee support $.some_array.length to get the length of an array in a JsonPath ExtractVarirable

If not, what is the alternative solution? Thanks

Solved Solved
0 1 208
1 ACCEPTED SOLUTION

No, I don't think so. But if you want the length of the array you can just do a JavaScript callout like this: 

var c = JSON.parse(context.getVariable('request.content'));
var length = c.some_array.length;
context.setVariable('extracted-array-length', length.toFixed(0));

View solution in original post

1 REPLY 1

No, I don't think so. But if you want the length of the array you can just do a JavaScript callout like this: 

var c = JSON.parse(context.getVariable('request.content'));
var length = c.some_array.length;
context.setVariable('extracted-array-length', length.toFixed(0));