MarcB

Retrieve Values from CAML Query Array

Discussion created by MarcB on Nov 20, 2017
Latest reply on Nov 20, 2017 by Matthias_Walter

I am trying to retrieve specific array values for the following CAML query.

 

The CAML Query works - but I'm unable to obtain the actual values for the field "Points_x0020_Completed". How do I access the array X so I can sum up all values in the field "Points completed"?

=============================================================

var varSum = 0;

var x = [[@Site.QueryList("My Site", "<Query><Where><Eq><FieldRef Name=\"Scrum_x0020_Team\" ></FieldRef><Value Type=\"Choice\">[[Scrum_x0020_Team]]</Value></Eq></Where></Query>", 10, "Points_x0020_Completed", "GRID")]];

for (var i = 0; i < x.length; i++) {

      if (x[i][i] >= 0) varSum = varSum + x[i][i];

}

return varSum;

Outcomes