Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
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 '13 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 –  Robert Lindgren Apr 29 '13 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 '13 at 9:07
    
Then thanks a lot for your help, it is indeed working fine with a SharePoint-hosted App. –  ggobbe Apr 29 '13 at 9:10
    
Please see updated answer, it should be possible but it might require more work to get it up and rollin' –  Robert Lindgren Apr 29 '13 at 9:27
show 3 more comments

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

share|improve this answer
    
Very true, you will always have the app web :) –  Robert Lindgren Jan 23 at 8:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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