I have a list called "Subscribed users" on the top level that has 3 columns storing a username, a name of a list or library, and an url to a page.

I use SPServices to look up if the current user is in that list, and if he/she is, I return the row details. In my test it does return a row since I checked it with the console (it returns my name, a name of a list called "TEST Documenten" and an url to a page).

When I do a console log of currentViewLLIB, it returns "TEST Documenten". When I do a console log of listLibraryName, it also returns "TEST Documenten". So basically both currentViewLLIB and listLibraryName return the same, yet when I use the currentViewLLIB in the second SPServices part it won't return any results whereas it does when I use listLibraryName.

I can't figure it out since both variables return the same value and one works while the other doesn't, I'm puzzled as to what might cause this.
Any idea on why this happens?

var USER = $().SPServices.SPGetCurrentUser({ 
        webURL: "", 
        fieldName: "Title", 
        fieldNames: {}, 
        debug: false

var currentViewUser;
var currentViewLLIB;
var currentViewPURL;

    operation: "GetListItems",
    async: false,        
    webURL: 'https://my-intranet-here.com/',
    listName: 'Subscribed users',
    completefunc: function (xData, Status) {
        $(xData.responseXML).SPFilterNode("z:row").each(function() {
            if ($(this).attr("ows_Title") == USER) {
                currentViewUser = $(this).attr("ows_Title");
                currentViewLLIB = $(this).attr("ows_ListLibID");
                currentViewPURL = $(this).attr("ows_PageURL");
                console.log('Found the current user!');


// This line works: 
//var listLibraryName = "TEST Documenten";

// This line does not work: 
var listLibraryName = currentViewLLIB;

$(function() {
        operation: "GetListItems",
        async: false,
        listName: listLibraryName,
        completefunc: function (xData, Status) {
            $(xData.responseXML).SPFilterNode("z:row").each(function() {
                var liHtml = $(this).attr("ows_ID");

Suggestions on what I should try are very welcome, your help is very much appreciated!

  • Try replacing 'Subscribed users' With 'Subscribed_x0020_users' Feb 28, 2014 at 9:29
  • But "Subscribed users" is the name of the list, not the name of a column. I can perfectly fetch data from that list, it's the second SPServices that can't seem to work with currentViewLLIB (even though it has the exact same value as the listLibraryName I commented).
    – Magali
    Feb 28, 2014 at 9:37
  • Why did you not specify webURL for the second function? Is the list in the same site?
    – kmo
    Feb 28, 2014 at 9:39
  • The list isn't in the same site but I'm planning on replacing it with the GUID so that it wouldn't need the webURL. And since it worked at first (with the first value of listLibraryName) I didn't think it would need a webURL.
    – Magali
    Feb 28, 2014 at 9:45
  • can You Just use single Quotes for 'listLibraryName' and try? Feb 28, 2014 at 10:09

1 Answer 1


Found it!
Instead of just using the name of a list, I stored the GUID of the list in "Subscribed users" and fetched that one. I then unescape it using this:


I can now call the list in the second SPServices part. :)

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.