Skip to main content

Search

Retrieve Values from CAML Query Array

Comments

1 comment

  • Matthias_Walter

    Hi Marc Bernard,

    you could use the GetValuesForQuery function on the web context object like this:

    var varSum = 0;
    var x = [[@Web.GetValuesForQuery("yourlistname", "<Where><Eq><FieldRef Name=\"Scrum_x0020_Team\" ></FieldRef><Value Type=\"Choice\">[[Scrum_x0020_Team]]</Value></Eq></Where>", "Points_x0020_Completed")]];
    for (var i = 0; i < x.length; i++) {
    if (x[i] >= 0) varSum = varSum + x[i];
    }
    return varSum;

     

    Simply replace the parameter "yourlistname" with yours.

    Cheers Matthias

    0

Please sign in to leave a comment.