Create column in list using Rest API in SharePoint Online Office 365

SharePoint online create list column using rest api

In this post, we will discuss how we can create a column in a list using Rest API in SharePoint Online Office 365 site. The same code will also work fine for SharePoint 2013 and SharePoint 2016.

Here in this demo let us take one textbox and one button. The user can give a column name in the textbox and click on the Submit button. Once the column created successfully it will display a successful message in the div whose id is “divResults”.

SharePoint deveopment training course

You can also check a few articles:
Delete SharePoint Site using Rest API in SharePoint Online Office 365

Working with Microsoft Flow in SharePoint Online Office 365 and Demo on Send a customized email when a new SharePoint list item is added

SharePoint 2016 Develop and deploy custom feature using Visual Studio 2015

For this particular example, let us use a script editor web part inside a web part page. In that script editor page, you can add the HTML code as well as the rest API code.

HTML Code:
Below is the html code


<strong>Enter Column Name:</strong>

<input type=”text” id=”txtColumnName” />

<input type=”button” id=”btnSubmit” value=”Create Column” />


<div id=”divResults”></div>

Rest API Code:
Below is the rest api code to create a column in a SharePoint online list.

Here is data, we are passing the metadata for the column like Title for the column and also we are providing the column type by using the FieldTypeKind property. This property gets or sets a value that specifies the type of the field.

FieldTypeKind : 1 -> integer value
FieldTypeKind : 2 ->single line of text
FieldTypeKind : 3 -> multiple lines of text etc.

You can see more on this msdn link.

<script src=””></script>


$(function () {



function bindButtonClick() {

$(“#btnSubmit”).on(“click”, function () {




function createColumn() {

var folderName = $(“#txtColumnName”).val();

var siteUrl = _spPageContextInfo.webAbsoluteUrl;

var fullUrl = siteUrl + “/_api/web/lists/GetByTitle(‘MyCompanyInfo’)/Fields”;


url: fullUrl,

type: “POST”,

data: “{ ‘__metadata’: { ‘type’: ‘SP.Field’ }, ‘Title’:'” + folderName + “‘, ‘FieldTypeKind’: 3 }”,

headers: {

“accept”: “application/json;odata=verbose”,

“content-type”: “application/json;odata=verbose”,

“X-RequestDigest”: $(“#__REQUESTDIGEST”).val()


success: onQuerySucceeded,

error: onQueryFailed



function onQuerySucceeded() {

$(“#divResults”).html(“Column Created Successfully !!!”);


function onQueryFailed() {




Now when we Save the page and refresh the page, the HTML will come. Give a name for the column and click on the button, which will successfully create the column in the list.

Create column in list using rest api sharepoint 2013
Create a column in the list using rest api SharePoint 2013

Now if you can navigate to the list settings page, you can see the new column has been added to the list like below:

SharePoint online create list column using rest api
SharePoint online create list column using rest API

Hope this will be helpful.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)


About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site

View all posts by Bijay Kumar →