In this post I have shared the process to create a new column in SharePoint list or library using REST API or PowerShell. The process is fairly simple and straight forward.
You need the following for this tutorial
- An application to call API endpoints such as Postman, VS code or Power Automate. I have used Power Automate (If you are not familiar with Power Automate, I would request you to check my beginners tutorial for Power Automate)
- You need to have at least edit permission in the SharePoint list (this is mandatory to create a column using any method, including REST API & PowerShell).
#1. SharePoint REST API
The API endpoint for creating a column is
As this is a creation request, a POST method is required. Also you need few headers and a request body. The request body contains the information about the new column you are trying to create. Such as column name, type, hidden etc. An example is shown in the below picture and the respective explanation is provided below.
As you can see in the above image, it is a simple POST API call to create a new column. A few parameters are passed in the content body with the column related information(explanation for each are below).
I have used the numbers(as per the image) to explain the details below.
- URI – The Uri is mentioned above.
A list guid is a unique identifier which can be found from the SharePoint list settings or by calling the list API( _api/web/lists/getbytitle(‘Title’) ) .
- Headers – headers carry validation, authentication or related information.
If you are calling the API from Power Automate (or a JS script within SharePoint) then you require only these two headers as shown in the above image. However if you are using any other applications such as Postman or VS code then you would need other headers such as accesstoken. More information regarding those can be found on the Microsoft documentation, however if you need any tutorial let me know in the comments.
- The type metadata SP.Field identifies that the POST request body is for a SharePoint Field(column)
- Title: The title you would like to show in the SharePoint list view
- FieldTypeKind: This is a numerical value which identifies the type of column(i.e. Text, number, hyperlink etc.). More information on this is provided below. However if you do not want to use the numerical value then, you can use the property TypeAsString.
- Required: Whether this column is mandatory to fill or not
- EnforceUniqueValues: Whether the information provided in this column should be unique or not
- staticname: static name of the column/field
- Hidden: Whether the field is hidden in the default view.
Details of the API
"Title": "field title",
"StaticName": "field name",
The above request should be enough to create a/multiple column in SharePoint using REST API. And if you call the API correctly with the above details, a column should be created as below. The column should show an error “Required information missing” and it should be visible in the default view.
If you have followed along then you should have at least two questions in your mind. They are
- What are the available values for FieldTypeKind (i.e. how to create other column types) ?
- And, is it possible to pass more parameters in the request body? For example description, default value etc.
Well, good news! I have both the answers for you below.
Q. What are the different field type values available ?
You can create every kind of available field types, using both REST API and PowerShell. Below is a table with some most commonly used FieldTypeKind values for SharePoint REST API. For all available FieldTypeKind values follow Microsoft documentation. You can use these values from the table to create different kinds of columns.
*Note – You should not use any invalid FieldTypeKind value in SharePoint REST API. It can cause issues
|Specifies that the field contains an integer value.
|Specifies that the field contains a single line of text.
|Specifies that the field contains multiple lines of text.
|Specifies that the field contains a date and time value or a date-only value.
|Specifies that the field contains a monotonically increasing integer.
|Specifies that the field contains a single value from a set of specified values.
|Specifies that the field is a lookup field.
|Specifies that the field contains a Boolean value.
|Specifies that the field contains a floating-point number value.
|Specifies that the field contains a currency value.
|Specifies that the field contains a URI and an optional description of the URI.
|Specifies that the field is a computed field.
|Specifies that the field contains a GUID value.
|Specifies that the field contains one or more values from a set of specified values.
|Specifies that the field is a calculated field.
|Specifies that the field contains the leaf name of a document as a value.
|Specifies that the field indicates whether the list item has attachments.
|Specifies that the field contains one or more users and groups as values.
|Specifies that the field indicates whether a meeting in a calendar list recurs.
|Specifies that the type of the field was set to an invalid value.
|Specifies that the field contains a content type identifier as a value.
|Specifies that the field indicates the status of a workflow instance on a list item.
|Specifies that the field indicates whether a meeting in a calendar list is an all-day event.
|Specifies that the field contains the most recent event in a workflow instance.
Q. Different properties available for SP.Field POST request body
Similar to the above table, below is a table with the most commonly used properties/parameters for SP.Field body. For full list of parameters, check the Microsoft document.
|Gets a value that specifies whether the field can be deleted.
|Gets or sets a value that specifies the default value for the field.
|Gets or sets a value that specifies the description of the field.
|Gets or sets a value that specifies the reading order of the field.
|Gets or sets a value that specifies whether to require unique field values in a list or library column.
|Gets or sets a value that specifies the type of the field. Represents a Field Type value. See FieldType in the .NET client object model reference for a list of field type values
|Gets a value that specifies whether list items in the list can be filtered by the field value.
|Gets or sets a value that specifies the field group.
|Gets or sets a value that specifies whether the field is hidden in list views and list forms.
|Gets a value that specifies the field identifier.
|Gets or sets a Boolean value that specifies whether the field is indexed.
|Gets a value that specifies the field internal name.
|Gets or sets a value that specifies whether the value of the field is read-only.
|Gets or sets a value that specifies whether the field requires a value.
|Gets or sets a value that specifies the XML schema that defines the field.
|Gets a value that specifies the server-relative URL of the list or the site to which the field belongs.
|Gets a value that specifies whether properties on the field cannot be changed and whether the field cannot be deleted.
|Gets a value that specifies whether list items in the list can be sorted by the field value.
|Gets or sets a value that specifies a customizable identifier of the field.
|Gets or sets value that specifies the display name of the field.
|Gets or sets a value that specifies the type of the field.
|Gets or sets a value that specifies the data validation criteria for the value of the field.
|Gets or sets a value that specifies the error message returned when data validation fails for the field.
That’s all you need to create a column using REST API in SharePoint Online. Next let’s check the PowerShell option
#2. Create SharePoint column using PowerShell
There are already many documents available online and as I do not wish to increase the document length, I have included the link of those documents instead of rewriting them again. If you have any questions feel free to ask in the comments.
That’s all I have for this document, create a SharePoint column using REST API and PowerShell. And I hope this to help you in your requirement.
Please Help us Grow!
I hope you have found this article helpful. If you are happy with the document, please use the below links when you buy something from Amazon to help us grow.
Ways to Help
Amazon Affiliate Links
How this works?
Amazon affiliate program gives a small (%)share of price to the referrers, so feel free to buy anything.
Below are some Amazon affiliate links, if you open amazon application/website using these links and buy something, (it can be one of the below items or anything of your choice) Then Amazon will give us a little percentage(%) of the money you spend on Amazon. To know more check this document.
For your Contribution
Ramiz is a professional working in an MNC as a business and technology consultant for quite a few years now. Ramiz is proficient in various Microsoft tools and technologies. He is a tech enthusiast and an active blogger. Ramiz spends his free time playing games or watching movies. He writes blogs to share his knowledge with the world and to make it a better place to live.