Count members of an array in JSON response and return the result.
Text
- Specifies JSON path expression pointing to the array node in JSON response.Integer
Count of items in the selected array from JSON response
With an example JSON:
{
"arrayNode":[1,2]
}
use the function as following:
_Counter := APIScriptRWU.COUNT_RESPONSE_MEMBERS_BY_JPATH('$.arrayNode'); //Returns 2
Function does not work with some advanced JSONPath expressions, for example, you are not able to count all
id
nodes in the JSON with syntax$..id
.
Function does not work properly with paginated result – it returns data from last page only.