Create Custom App Properties in SharePoint Office 365

Step 1: Create a SharePoint hosted app using Visual Studio 2013.

File -> New -> Project,

project

Step 2: Select app for SharePoint. Enter the name of the project and click Ok.

name

Step 3: Select SharePoint hosted and click next button.

next

The solution structure shows as follows.

solution

Step 4: Right click Project -> Click Add -> click New Item,

New Item

The following screen will appear. Select Client Web Part and enter the name of web part. Click Add.

Add

Click Finish to continue.

Finish

The solution structure looks as follows.

structure

Go to element.xml page under DemoApp.

element

element

In custom App properties here I set App name and list name in properties tag as follows,

  1. <Properties>  
  2.     <Property Name="AppName" Type="string" WebBrowsable="true" WebDisplayName="APP Name" WebDescription="Provide your App Title" WebCategory="Demo App Properties" DefaultValue="Demo App" RequiresDesignerPermission="true" />  
  3.     <Property Name="ListName" Type="string" WebBrowsable="true" WebDisplayName="List Name" WebDescription="Provide your Demo App List Name" WebCategory="Demo App Properties" DefaultValue="DemoList" RequiresDesignerPermission="true" />  
  4. </Properties>  
Here give the inputs for the app name and list name. And also include the property in content type.
  1. <Content Type="html" Src="~appWebUrl/Pages/DemoApp.aspx?{StandardTokens}&AppName=_AppName_&ListName=_ListName_" />  
code

Save and deploy the solution. Go to your SharePoint site contents.

deploy

Create one web part page in site pages and add an app in that page.

Create

Edit web part using drop menu.

web part

web part

The given app properties are shown as follows.

properties
Summary

In this blog we have explored how to create custom app properties in SharePoint Office365 using a SharePoint hosted app.