BE_JSON_ArraySize

BE_JSON_ArraySize(json;{path})



Will return the number of values in a JSON array.  If now path is included, it counts the array at the root of the JSON, and will return 1 for a non array type.  If a path is included, the format is as per the https://support.baseelementsplugin.com/hc/en-us/articles/204700858-BE-JSONPath-Deprecated JSONPath function, which is NOT the same as the internal FileMaker JSON functions introduced in version 16.

Parameters:

- json : the array to count.

- path : the path within the JSON to locate the array to count.

Keywords:

JSON Array Size


Version History:

- 2.1 :

- 4.1 : Added the optional path parameter.

Code Examples:

BE_JSON_ArraySize ( " [ { " &  BE_JSON_Encode ( "firstName" ; "John" ) & ", " & BE_JSON_Encode ( "lastName" ; "Doe" ) & " }, { " &  BE_JSON_Encode ( "firstName" ; "Anna" ) & ", " & BE_JSON_Encode ( "lastName" ; "Smith" ) & " }, { " &  BE_JSON_Encode ( "firstName" ; "Peter" ) & ", " & BE_JSON_Encode ( "lastName" ; "Jones" ) & " } ]" )


Still need help? Contact Us Contact Us