title: JSON path for getting total number records in its response
body: <p>I’m working with wso2esb 4.9.0 and Wso2dss3.0.0</p>
  
  <p>I have a SOAP response from a DSS service as shown below</p>
  
  <pre><code> &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;DataCollection xmlns="http://ws.wso2.org/dataservice"&gt;
           &lt;Datalist&gt;
              &lt;partybranchid&gt;2127629166052452&lt;/partybranchid&gt;
              &lt;partybranchname&gt;other locations&lt;/partybranchname&gt;
              &lt;status&gt;1&lt;/status&gt;
              &lt;partybranchtype&gt;-1&lt;/partybranchtype&gt;
              &lt;partyid&gt;460077453499443&lt;/partyid&gt;
              &lt;partyname&gt;Yash Technologies Pvt Ltd&lt;/partyname&gt;
              &lt;ouid&gt;-1&lt;/ouid&gt;
              &lt;organizationunitname&gt;NONE&lt;/organizationunitname&gt;
              &lt;inchargeid&gt;-1899999899&lt;/inchargeid&gt;
              &lt;sbuheadid&gt;-1&lt;/sbuheadid&gt;
              &lt;usercriteriaconfigid&gt;1187416899913503&lt;/usercriteriaconfigid&gt;
              &lt;primarymail&gt;vikash@myunisoft.com&lt;/primarymail&gt;
           &lt;/Datalist&gt;
           &lt;Datalist&gt;
              &lt;partybranchid&gt;2545910581364239&lt;/partybranchid&gt;
              &lt;partybranchname&gt;DBPB001&lt;/partybranchname&gt;
              &lt;status&gt;1&lt;/status&gt;
              &lt;partybranchtype&gt;2299733851146138&lt;/partybranchtype&gt;
              &lt;partyid&gt;2534954639984412&lt;/partyid&gt;
              &lt;partyname&gt;DBPRTY001&lt;/partyname&gt;
              &lt;ouid&gt;2538210579514587&lt;/ouid&gt;
              &lt;organizationunitname&gt;DBORG001&lt;/organizationunitname&gt;
              &lt;inchargeid&gt;2540093122446574&lt;/inchargeid&gt;
              &lt;sbuheadid&gt;1209449655666077&lt;/sbuheadid&gt;
              &lt;usercriteriaconfigid&gt;1187416899913503&lt;/usercriteriaconfigid&gt;
              &lt;primarymail&gt;vikash@myunisoft.com&lt;/primarymail&gt;
           &lt;/Datalist&gt;
        &lt;/DataCollection&gt;
     &lt;/soapenv:Body&gt;
  </code></pre>
  
  <p>From the above SOAP response, Iwant to get the total number of <code>Datalist</code> records in to my  service. For this I have given a JSON property document as shown below:</p>
  
  <pre><code>&lt;property name="Total"
               expression="json-eval($.DataCollection.Datalist.length)"
               scope="default"
               type="STRING"/&gt;
  </code></pre>
  
  <p><code>Total</code> should get the value as <code>2</code>, because they are two records, as you can see; but this is instead returning <code>null</code>. I think the JSON path i gave is not working.</p>
  
  <p>What would be the right JSON path to count the number of records?</p>