Step 1: Create a SharePoint hosted app using Visual Studio 2013.
File -> New -> Project,
Step 2: Select app for SharePoint. Enter the name of the project and click Ok.
Step 3: Select SharePoint hosted and click next button.
The solution structure shows as follows.
Step 4: Right click Project -> Click Add -> click New Item,
The following screen will appear. Select Client Web Part and enter the name of web part. Click Add.
Click Finish to continue.
The solution structure looks as follows.
Go to element.xml page under DemoApp.
In custom App properties here I set App name and list name in properties tag as follows,
- <Properties>
- <Property Name="AppName" Type="string" WebBrowsable="true" WebDisplayName="APP Name" WebDescription="Provide your App Title" WebCategory="Demo App Properties" DefaultValue="Demo App" RequiresDesignerPermission="true" />
- <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" />
- </Properties>
Here give the inputs for the app name and list name. And also include the property in content type.
- <Content Type="html" Src="~appWebUrl/Pages/DemoApp.aspx?{StandardTokens}&AppName=_AppName_&ListName=_ListName_" />
Save and deploy the solution. Go to your SharePoint site contents.
Create one web part page in site pages and add an app in that page.
Edit web part using drop menu.
The given app properties are shown as follows.
Summary
In this blog we have explored how to create custom app properties in SharePoint Office365 using a SharePoint hosted app.