Create Indexed Columns in SharePoint Using Power Automate

Last week, one of my customers purchased my small flow “Create List With Different Types of Columns using Power Automate.” After using it, they came back with an additional request: they wanted to automatically add an indexed column whenever a new column is created in SharePoint.

If you want to explore more, you can download 50+ Power Platform solutions and try them in your own environment.

In this tutorial, I will show you how to create indexed columns in SharePoint using Power Automate.

Create Indexed Columns in SharePoint Using Power Automate

For this example, I have a SharePoint list called Project Tracker, and I want to create a column named Project Code.

Power Automate flow to automatically create indexed columns in SharePoint list

I also want this column to be automatically added as an indexed column, so I don’t have to do it manually every time.

Now, follow the steps below to do this:

  1. Go to Power Automate and click Create -> Instant Cloud Flow. Select Manually trigger a flow as the trigger. Click + Add an input and add the following inputs:
    • Site URL (Text): Enter the SharePoint site URL where the list will be created.
    • List Name (Text): Enter the display name of the SharePoint list.
    • Column Display Name (Text): Enter the display name of the column you want to create in the list.
    • Column Internal Name (Text): Enter the internal name of the column (used by SharePoint for APIs and automation).
SharePoint list create indexed columns via Power Automate
  1. Then add a Send an HTTP request to SharePoint action from sharePoint Connector with the below parameter to create the column:
    • Site Address: Provide the Site URL dynamic content.
    • Method: POST
    • URI: _api/web/lists/getbytitle(‘list name from dynamic content‘)/fields
    • Headers:
      • Accept: application/json;odata=verbose
      • Content-Type: application/json;odata=verbose
    • Body:
{
  "__metadata": {
    "type": "SP.Field"
  },
  "FieldTypeKind": 2,
  "Title": "@{triggerBody()?['text_2']}",
  "InternalName": "@{triggerBody()?['text_3']}",
  "Required": false
}

Here:

  • text_2 = Column display name.
  • text_3 = Column internal name.
How to use Power Automate to index SharePoint list columns

Once the column is created, we immediately send another HTTP request to update the same column and mark it as indexed.

  1. Add another Send an HTTP request to SharePoint action with the following parameters:
    • Site Address: Provide the Site URL dynamic content.
    • Method: POST
    • URI:
      • _api/web/lists/GetByTitle(‘@{triggerBody()?[‘text_1′]}’)/fields/GetByTitle(‘@{triggerBody()?[‘text_2′]}’)
    • Headers:
      • Accept: application/json;odata=verbose
      • Content-Type: application/json;odata=verbose
      • IF-MATCH: *
      • X-HTTP-Method: MERGE
    • Body:
{
  "__metadata": {
    "type": "SP.Field"
  },
"Indexed": true
}
Indexing SharePoint columns using Power Automate

Run the Flow to Create Indexed Columns in SharePoint

Once your flow is built, it’s time to test it to make sure it works as expected.

  1. Save the flow and click Test in the top-right corner of Power Automate.
  2. Select Manually and click Run Flow.
  3. Fill in the inputs you added in the trigger:
    • Site URL: Your SharePoint site URL.
    • List Name: The list where the column should be created (e.g., Project Tracker).
    • Column Display Name: Name of the new column (e.g., Project Code).
    • Column Internal Name: Internal name (e.g., ProjectCode).
  4. Click Run Flow.
SharePoint Online automation to add indexed columns using Power Automate

After the flow runs successfully:

  • Go to your SharePoint list settings -> Columns -> Check if your new column has been created.
SharePoint indexed columns using Power Automate
  • Then, click on Indexed columns, and you can see that the index column has been successfully created.
Create Indexed Columns in SharePoint Using Power Automate

The above example uses a single line of text (FieldTypeKind: 2). If you want to create a number, date, or choice column, update FieldTypeKind accordingly.

You may also like the following tutorials:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App