This project has moved. For the latest updates, please go here.

SPServices in SharePoint Hosted App appending app name to passed in webUrl

Sep 12, 2013 at 2:30 AM
I'm using Napa to create a SharePoint Hosted App and have been able to successfully use GetListCollection to get a list. Problem is that when I get the list it is from the url with the app appended to it and only returns 2 lists; "Master Page Gallery" and "Composed Looks". I decided to add a new list like so:
            operation: "AddList", 
            webUrl: spHostUrl,
            listName: "myList",
            description: "this is my new list",
            templateID: 104,
            completefunc: function( xData, Status){
        } );
The list is successfully added to the /site/mySiteCollection/myApp list and can now be read. I tried putting in the webUrl for the site that i want it to go to and it still tries to create it in the site address the myapp name included. Does webUrl not work on Hosted Apps?

I need to get to the lists at the site collection level, not the site collection + appName level.

What could I be doing wrong?

Sep 12, 2013 at 3:05 AM
I think it's a simple little spelling thing. The option is webURL, not webUrl.

Sep 12, 2013 at 3:33 AM
That was it exactly. I've been looking for 6 hours - THANK YOU!!!!
Sep 12, 2013 at 3:45 AM
You're welcome!

Oct 8, 2013 at 6:50 PM
I wanted to be sure that I understood where you wanted to create the list in this. I am asking mainly because I am trying to validate that SPServices will not talk to the "Host Web" of the app. Even running this code, I can check the host web and the list is not there, but it is present in the app web which makes sense to me. I just wanted to be sure that my thoughts are correct in that you cannot access the host web using SPServices ( as much as I would like to! )