Adding a column to a SharePoint list is pretty simple job, you need Edit permission on the list to update the list column index and also item count in list must be less than 20000 as you can not add a field to list index if item count is over 20K.
You can add upto 20 index columns in list. For adding a index column using interface you have to go to list settings and click on Indexed columns, it will take you to the indexed column page.
Click on Create a new index link and select the column shown in drop down. You can have index column by selecting the dropdown link. You can see few of the column from your list/library are not showing in the list because there are few column types which are supported, and few are not supported. Check this link for details on supported column types.
Adding Index column using PowerShell
I have created a simple PowerShell script which can be used to add/remove list, you can download the script from TechNet.
In below CSOM script written in PowerShell, you can see that after loading the list, I am getting the Documents and then fetching the Title field and then updating the field index value to true.
$list = $ctx.Web.Lists.GetByTitle(“Documents”) $field = $list.Fields.GetByTitle(“Title”) $field.Indexed = $true $field.Update() $ctx.ExecuteQuery()
In above screenshot, you can see the title field created using powershell script. yo
No Comments