GetListItems - webURL - using for the same Pages library with multiple subsites

Nov 13, 2015 at 10:47 AM
Hello!

I am using GetListItems with a success for a Pages library in a parent site in SP2010 and I would like to do exacly the same thing for all subsites. Can I specify multiple values to webURL with an array? How to do it properly?

My current working code for one URL webURL1:
       $().SPServices
({
            operation: method,
            async: false, 
            webURL: webURL1, 
            listName: list,
            CAMLViewFields: fieldsToRead,
            CAMLQuery: selected_menu_category,
            completefunc: function (xData, Status)
             {
                 $(xData.responseXML).SPFilterNode("z:row").each(function() 
                 {
                      var Title = $(this).attr("ows_Title");
                      var EncodedAbsUrl =  $(this).attr("ows_EncodedAbsUrl"); 
                      $(".selected_menu_category").append(
                      "<li>" + "<a href="+EncodedAbsUrl+">"+Title+"</a></li>" );
                   });
           }
I have a set of 30 subsites var webURL1, var webURL2, var webURL3 ... var webURL30. How to use that set as an array in SPSServices - webURL: [webURL1, webURL2, webURL3] ;
Coordinator
Nov 13, 2015 at 9:36 PM
The SOAP call will only work with one webURL /listName at a time. You can wrap your call in an outer loop that passes in the values for webURL and listName for each of the subsites.

M.