Creating Apps With List Using Visual Studio In SharePoint 2013 Online

Updated: Jan 30


Introduction

In this article I am going to demonstrate how we can create an App with Announcement list. Creating Apps is simple in SharePoint, this article is mainly targeted for freshers to SharePoint 2013.

Steps to Create App


1. Run Visual studio as administrator and create new SharePoint 2013 App.



2. Provide a web URL in which you are going to deploy this App and select option SharePoint-hosted option.


3. Add SharePoint list (name as Announcements) to that project,


4. Select Announcements list template to create this list.


5. Add new announcements to the list, add below data rows in ‘Announcement’ List Element file. This will add the events.

  1. <?xml version="1.0" encoding="utf-8"?>  

  2. <Elements xmlns="http://schemas.microsoft.com/sharepoint/">    

  3. <ListInstance Title="Announcements"                 

  4. OnQuickLaunch="TRUE"                 

  5. TemplateType="10000"                 

  6. Url="Lists/Announcements"                 

  7. Description="My List Instance">      

  8. <Data>        

  9. <Rows>          

  10. <Row>            

  11. <Field Name="Title">RK Announcement 1</Field>          

  12. </Row>          

  13. <Row>            

  14. <Field Name="Title">RK Announcement 2</Field>          

  15. </Row>          

  16. <Row>            

  17. <Field Name="Title">RK Announcement 3</Field>          

  18. </Row>          

  19. <Row>            

  20. <Field Name="Title">RK Announcement 4</Field>          

  21. </Row>          

  22. <Row>            

  23. <Field Name="Title">RK Announcement 5</Field>          

  24. </Row>        

  25. </Rows>      

  26. </Data>    

  27. </ListInstance>  

  28. </Elements>  

6. Deploy the project and browse the App.

7. Edit the default home page and add WebPart zone to that and add the announcement list which we created in the App.

  1. <h1>My App with Announcement List !!!</h1>      

  2. <br />     

  3.  <br />      

  4. <!-- Adding webpart zone to add the announcement list -->      

  5. <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly"         

  6. ID="full" Title="loc:full">          

  7. <WebPartPages:XsltListViewWebPart ID="XsltListViewWebPart1"             

  8. runat="server" ListUrl="Lists/Announcements" IsIncluded="True"             

  9. NoDefaultStyle="TRUE" Title="Announcements" PageType="PAGE_NORMALVIEW"             

  10. Default="False  

8. Browse the home page, the app is created with the announcement list with added announcements.


Hope this article helps you in creating simple SharePoint Online Apps with Lists, we can also create custom lists where we manually need to add the fields and others.



Recent Posts

See All