1

Using Text Filter I have filtered the List, now I need to count how many records have been filtered. Is it is feasible in SharePoint out of box feature?

For example: In Text Filter if I type "Oracle" where ever the word Oracle is present in the list it displays all the rows, Now I need to know the count of the word Oracle present in that list.

4
  • You can create a calculated column and find the occurance of the word Oracle in the item and find the count.
    – samolpp2
    Commented Dec 30, 2015 at 5:34
  • Ok, let me try and let you know.
    – Bagavathi
    Commented Dec 30, 2015 at 5:35
  • you can look at this link for the first approach : stackoverflow.com/questions/978057/…
    – samolpp2
    Commented Dec 30, 2015 at 5:55
  • In your list view, couldn't you just put a total on the Title field and then it should give you the count of matching items. Commented Dec 30, 2015 at 13:58

1 Answer 1

1

Another approach is to use SPServices library to access the list items through the JavaScript and jQuery and find the word Oracle in the item and declare a variable count, increase this variable whenever you find this variable and find the sum.

Add SPServices code inside a Content Editor Web Part and hide this web part. Download the SPServices library, jQuery library.

Below is just a sample code,and its incomplete, you can further google it out to get the remaining.

     <script language="javascript" 
     src="/ursitecollec1/AssetLibrary1/jquery-1.6.0.min.js" 
      type="text/javascript"></script>
       <script language="javascript" 
         src="/ursitecollec1/AssetLibrary1/jquery.SPServices-
        2014.01.min.js" type="text/javascript">
       <script language="javascript" type="text/javascript">

    $(document).ready(function() {
    $().SPServices({    
   operation: "GetListItems",  
   async: false,  
            listName: "YourSPListName",
            CAMLQuery: "<Query><Where><IsNotNull><FieldRef Name='Title'/>
         </IsNotNull></Where></Query>",
            CAMLViewFields: "<ViewFields><FieldRef Name='Title' />
     <FieldRef Name='yourOraclewordListColumnName' /></ViewFields>",  
CAMLRowLimit: 0,
completefunc: function (xData, Status) 
            {  
                     //alert(' inside completfunc xdata.responsexml is 
         .....'+ xData.responseXML); 
       //var itemCount =   
         $(xData.responseXML).SPFilterNode("z:row").attr("ItemCount");  
      //alert("itemCount :" + "" + itemCount);
       var count = 0;  
  //$(xData.responseXML).find("[nodeName='z:row']").each(function()   
              $(xData.responseXML).SPFilterNode("z:row").each(function()   
  {  
    count = count + 1;   

                            //console.log(' current count is ..'+ count);
                                   //alert(xData.responseText);
     //alert(xData.responseXML.xml);
       var titleofresourcelist =  $(this).attr("ows_Title");
    var titleofresourcelist =  
     $(this).attr("ows_yourOraclewordListColumnName");
1
  • ok, thanks for sharing, let me try this and let you know.
    – Bagavathi
    Commented Dec 30, 2015 at 5:52

Your Answer

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