Create list item using JavaScript object model in SharePoint 2013

In this post we will discuss about how to Create list item using JavaScript object model (jsom) in SharePoint 2013. Also you can check out my previous posts on:

Change page layout programmatically SharePoint 2010

SharePoint deveopment training course

Fix width of master page in SharePoint 2013

Apply html to email template in SharePoint 2010 designer workflow

function createListItem(siteUrl) {
var clientContext = new SP.ClientContext(siteUrl);

var list = clientContext.get_web().get_lists().getByTitle(‘MyCustomList’);

var itemInfo = new SP.ListItemCreationInformation();

this.listItem = list.addItem(itemInfo);

listItem.set_item(‘Title’, ‘Item-1’);

listItem.set_item(‘Description’, ‘Item-1 Description’);




Function.createDelegate(this, this.onQuerySucceeded),

Function.createDelegate(this, this.onQueryFailed)

function onQuerySucceeded() {
alert(‘Item created: ‘ + listItem.get_id());

function onQueryFailed(sender, args) {
alert(‘Could not create list item ‘ + args.get_message());

The above code will add an item to the list.

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 →