In this example, we will create site columns through SharePoint Hosted Apps. Follow the below steps to create site columns in the existing List (EmpDetails).

  1. Create List through SharePoint Hosted App, using Visual Studio.
  2. Add custom Site Columns to the project.
  3. Add those site columns to Existing List (EmpDetails)
  4. Add the data to the List.

Step 1 - Create List through SharePoint Hosted App using visual Studio

For the first step, we have already created the list (EmpDetails) through SharePoint Hosted app.

Please refer to the below URL or article to create List in Visual Studio.

Step 2 - Add Custom Site Columns to project

For this example, I am going to add three site columns to the project.

  1. PartNo
  2. PartName
  3. PartType

Find the below steps to create Site columns.

In this example, we learned how to add site columns to List through VS. In coming articles, will learn how to create Content Type through Visual Studio, using SharePoint Hosted App. I have attached the source code for your reference. You can download and test it.