Create List in Apps

While working with SharePoint 2013 Apps, we might need a List to store our data.

For example:

  • A Timesheet App requires List
  • A Ticket Tracking App requires List

In this article, I would like to take you through the steps in creating lists for apps.

Host Web & App Web

We have to keep in mind that:

  1. Host Web is the web where our App is installed (example: http://hpvm.sharepoint.net)
  2. App Web is the isolated site collection of corporate app catalog (example: http://app-df9989b8b0ad44.sharepointapps.net/)

image

The reason why App Web is separated is due to Security.

Please note that the App Web do not have Site Settings option. In our case List will be created in App Web!

Creating List

Run Visual Studio 2012 & Create a new App Project.

image

Choose the type of hosting as SharePoint-hosted

image

Click the Finish button to continue.

From the Solution Explorer choose Add New Item > List

image

Choose the Custom List template.

image

Click the Finish button.  In the appearing List Designer, you can create new fields, create views, change field properties etc.

image

Save changes & Run the App.

image

How to view the list?

You can view the list using the direct URL of list name.

http://appdomain/AppName/Lists/ListName/AllItems.aspx

image

This concludes our List creation for SharePoint 2013 App.

image

References

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

Summary

In this article we have explored how to create List for an App.  I believe this will be useful in real-life scenarios.

Leave a Reply

Your email address will not be published. Required fields are marked *