I am trying to carry out a number of queries on a share point list. I know you can use CAML queries to filter the list to only show specific information. However I am looking to retrieve the entire list first and then carry out my filters. Is there anyway this can be done?

For example, retrieve the list then filter the list to show how many entries were logged under a specific category (a choice field) e.g. complaint, feedback etc..

I want to be able to do run the queries after I retrieve the list so I do not have to keep writing separate functions to basically retrieve the same list over and over again.

1 Answer 1


Get list item data as json so you could filter based on attribute.

Simple demo:

var terms = [{ "termID": "1", "termName": "term1", "termCity": "City1" }, { "termID": "2", "termName": "term2", "termCity": "City2" }, { "termID": "3", "termName": "term3", "termCity": "City3" }];
            var filtervalue = '2';
            var filterdTerm = terms.filter(function (a) {
                return a.termID === '' + filtervalue + '';
            var otherTerms = terms.filter(function (a) {
                return a.termID !== '' + filtervalue + '';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.