Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Get list of files within folder

$
0
0
Can you post the complete SPServices command that you used to display the list of files in a folder? I am trying to do the same, but cannot seem to retrieve any entries.
I've tried:
                               var folderName = '/xyz/SiteAssets/SitePages/junkanoo/images';
    $().SPServices({
        operation: "GetListItems",
        webURL: "https://xxxxxxxxxxxxxx/",
        CAMLViewFields: "<ViewFields><FieldRef Name='Title'/><FieldRef Name='Category'/></ViewFields>",
        CAMLQuery: "<Query><Where><Contains><FieldRef Name='FileRef' /><Value Type='Text'>" + folderName + "</Value></Contains></Where></Query>", 
        CAMLQueryOptions: "<QueryOptions><Folder>" + folderName + "</Folder></QueryOptions>",
        completefunc: function(xData2, Status) {
            $(xData.responseXML).find("[nodeName='z:row']").each(function(i) {
                var $node = $(this);
                newArr.push([$(this).attr('ows_Title')
                ]);
            });
        }
    });
    alert(newArr.length);

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>