2

I've seen that when I create an Autohosted App for SharePoint 2013 (or any other type of Apps), I'm then able to add a new item to the SharePoint Project such as a List.

I can then add/edit/delete fields of this lists through Visual Studio but when I deploy the App on my SharePoint-Online site, I can't see if or where the lists are created.

Could you please tell me :

  1. Are the lists in my App available somewhere on my site when my app is published?
  2. How can I access theses lists contained in my App? (or what are the purpose of theses lists in my App if I can't access them...)

Thanks a lot !

By the way here is a screenshot of my projects in VS2012 :

SharePoint Project

2 Answers 2

1

It is available on the App Web under

"The APPWEB URL"/Lists/"The list internal name"

But really you should access the list (CRUD items) via Client object model or REST.

The list is meant to be "hidden" to the users of the app, and it is upp to you to provide interfaces to work with items in the list

And just a clarification: You need to use SharePoint hosted app to be able to use SharePoint artifacts like Lists directly in the App project

Though this one tells another story: enter image description here

While this below tells this story (MSDN):

SharePoint-hosted apps for SharePoint are installed on a SharePoint 2013 website, called the host web, and that have their resources hosted on an isolated subsite of a host web, called the app web. This approach enables you to reuse common SharePoint artifacts, such as lists and Web Parts. When you take this approach, you can use only JavaScript and you cannot use any server-side code.

Benefit: This approach enables you to reuse common SharePoint artifacts, such as lists and Web Parts.

Consideration: You can use only JavaScript in the app, and you cannot use any server-side code.

http://msdn.microsoft.com/en-us/library/fp179887.aspx describes different hosting alternatives and their ups and downs. (But it is surely not too extensive)

So, you could use a List also in the other hosting alternatives, it will be added to the App Web though.

7
  • I tried to access the list through "My APPWEB URL/Lists/Calendrier" but I don't work. I also tried throug CSOM : var list = web.Lists.GetByTitle("Calendrier"); But it can't found the list that I've created in my sharepoint app. Am I doing something wrong?
    – ggobbe
    Apr 29, 2013 at 8:57
  • How are you provisioning the List? Is it through a ListInstance and then activated through a Feature in the App Project? That is how you should do it. But keep in mind that the app needs to be SharePoint hosted Apr 29, 2013 at 9:00
  • Ok that's why it doesn't work, my app is an Autohosted App. Thus there is no way to create a List in an Autohosted App that will be published on the site where the app is deployed?
    – ggobbe
    Apr 29, 2013 at 9:07
  • Then thanks a lot for your help, it is indeed working fine with a SharePoint-hosted App.
    – ggobbe
    Apr 29, 2013 at 9:10
  • Please see updated answer, it should be possible but it might require more work to get it up and rollin' Apr 29, 2013 at 9:27
1

We can create our custom SharePoint artefacts like list,content types as part of our Auto Hosted or Provider hosted apps too and not only in SharePoint Hosted apps.

Your feature and list will be deployed in the AppWeb which is a subsite that gets created whenever a new app is created. So instead of checking for the list and the feature in the host web, You can see them as part of the AppWeb.

You can find the AppWeb's url from Site Settings->Site Collection Administration section->Site hierarchy, Title will be your App name.

Once you know the url, You can visit the manage features page of the App Web through "URL_of_app_web/_layouts/15/ManageFeatures.aspx". Here you can see your feature already activated if it has been properly deployed.

And to see your list visit "URL_of_app_web/lists/list_internal_name". Here you can see your list along with his items.

Following is a detailed guide on creating custom SharePoint artefacts in Auto Hosted and Provider Hosted apps,

http://msdn.microsoft.com/en-us/library/office/fp179936.aspx

1
  • Very true, you will always have the app web :) Jan 23, 2014 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.