How To Set Column Order in SharePoint Document Library 2013/2016 using CSOM?

Hello SharePointers,

In this blog, I will give you piece of CSOM code to set column order in SharePoint document library.


var ctx = new SP.ClientContext.get_current();
var list = ctx.get_web().get_lists().getByTitle(‘Custom List’);

var listContentTypes;

listContentTypes = list.get_contentTypes();


ctx.executeQueryAsync(get_contentTypes_success, onFailure);

function get_contentTypes_success() {
var itemContenTypes = listContentTypes.getItemAtIndex(0);
var itemContenTypeFieldLink = itemContenTypes.get_fieldLinks();
itemContenTypeFieldLink.reorder([‘Employee_x0020_Number’, ‘Title’]);

ctx.executeQueryAsync(field_reorder_success, onFailure);

function onFailure(sender, args) {

function field_reorder_success() {

Happy SharePointing folks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *