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

New Post: GetListItems only returning rows from the person logged in.

$
0
0
The Web Services will only return those items to which the current user has permissions. So yes, it could be a permissions thing.

It looks like what you are trying to do is get a unique list of StaffName values. Since you haven't sorted by that column, you will get unpredictable results.
var users = [];

$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: listName,
    CAMLViewFields: "<ViewFields><FieldRef Name='StaffName' /></ViewFields>",
    CAMLQuery: "<Query><OrderBy><FieldRef Name='StaffName'/></OrderBy></Query>",
    completefunc: function(xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
            //if the name is already in the array then don't re-add or move indexvar thisStaffName = $(this).attr("ows_StaffName");
            if(users[thisStaffName] === undefined) {
                users.push(thisStaffName);
            }
        });
    }
});
M.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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