jfencil

How to count number of parent elements for this JSON array

Discussion created by jfencil on Mar 26, 2018
Latest reply on Mar 27, 2018 by jfencil

Hello all,

 

I am making a request to check an API for a particular asset: 157805

 

How would I count the number of records returned for this JSON array?

 

Example below: (modified to only show asset data)

 

- {"result":[{"parent":"", "asset_tag":"157805"},

 

- {"parent":"","asset_tag":"157805"}]}

 

My thoughts are that I should be using the Native FileMaker JSON function:

 

JSONListKeys ( $data ; "result" ) ;

 

The result is:

 

0

1

 

I was able to count these two data points using ValueCount($data)

 

I just answered my own question - so hopefully this helps someone else! -JF

Outcomes