How to Create SharePoint Online List Using Power Automate Rest API?

In this Power Automate tutorial, I will explain how to create SharePoint Online list using Power Automate Rest API.

I will also show you how to add different SharePoint list columns, such as Text, Date & Time, Choice column, Yes/No, Number, and Currency using Power Automate.

How to Create SharePoint Online List Using Power Automate Rest API

Here, I will discuss creating a new SharePoint custom list from the base template using a Rest API call.

Follow the below steps:

1. Navigate to Power Automate, then click + Create -> Instant cloud flow. Select Manually trigger a flow -> click on Create -> In the trigger, add the below-given inputs:

  • List Name – Text
  • Description – Text
Create new SharePoint list using Power Automate

2. To create a new SharePoint list, add a Send an HTTP request to SharePoint flow action to call the rest API.

Configure the below parameters:

  • Site Address: Provide the SharePoint site address where you want to create the list.
  • Method: Select the POST method from the drop-down.
  • Uri: Give the below-placed URI.
_api/web/Lists
  • Headers: Enter the below given values in it.
{
  "Accept": "application/json;odata=verbose",
  "Content -Type": "application/json"
}
  • Body: Place the below given value.
{
  "AllowContentTypes": true,
  "BaseTemplate": 100,
 "ContentTypesEnabled": true,
 "Description": "@{triggerBody()?['text_1']}",
 "Title": "@{triggerBody()?['text']}"
}

In the above code, replace your List Name and Description.

Power Automate create a SharePoint Online list

3. After that, save and test the flow manually. In the Runflow window, provide the List and Description for the list as shown below:

How to create a new SharePoint list using Power Automate

4. The image below shows a new SharePoint list in the SharePoint site with the default Title column as shown below:

Create a SharePoint list using Power Automate

This is how to create a custom SharePoint list using Power Automate Rest API.

Create SharePoint List Columns Using Power Automate

In the above section, we have seen how to create a custom SharePoint list; now, I will show you how to add different types of columns to the created SharePoint list using Power Automate.

Follow the below steps to do this:

1. Do follow the above section to create a new SharePoint list.

2. To get the value of the SharePoint list ID, take the Parse JSON flow action. Configure the below details:

  • Content: Take the Body value of Send an HTTP request to SharePoint from dynamic content.
  • Schema: Click on Generate from sample button. Copy and paste the Body outputs from the Send HTTP request to SharePoint.
Create a automatic list in SharePoint using Power Automate

3. After that, take an Initialize variable flow action to get the value of the URI that is used to add the list columns in SharePoint.

Fill in the details that are required to configure:

  • Name: Provide a name for a variable
  • Type: Select type as String
  • Value: Take the below-given code
_apisplit(body('Parse_JSON')?['d']?['__metadata']?['id'],'_api')[1]
How to create a custom SharePoint list using Power Automate

4. Now, I intend to add Send an HTTP request to SharePoint flow action. Configure the details below:

With this Rest API call, I will add a Number column to the SharePoint list.

  • Site Address: Choose the SharePoint site address.
  • Method: Select the POST method from the drop-down.
  • Uri: Give the below-placed URI that takes variable output.
@{variables('List Uri')}/Fields
  • Headers: Enter the below given values in it.
{
  "content-type": "application/json;odata=verbose",
  "accept": "application/json;odata=verbose"
}
  • Body: Place the below given value.
{ '__metadata': { 'type': 'SP.Field' }, 'Title':'Contact Number','FieldTypeKind':9}

Replace the Contact Number field with your Number column name.

Create a new column in SharePoint list from Power Automate flow

5. Similarly, to add the list columns below, Include the same step as above [Send an HTTP request to SharePoint] and configure the details.

To add each list column to SharePoint, we must change the FieldTypeKind value in the Body of the Send an HTTP request to SharePoint flow action.

Field TypeField Type Value
Single line of Text2
Number column9
Choice column6
Yes/No column8
Date and Time column4
Currency10
We can not be add multiple list columns at a time, becuase REST API does not allow to add it. To add the the SharePoint list columns, we have to call rest api for each single time.

6. Now, the flow is ready. Save and Run the flow. Test the flow manually.

7. In the Runflow window, provide a List Name and Click the Runflow button.

How to create a column in the SharePoint list with Power Automate

8. The image below displays the creation of a SharePoint list with the provided list columns.

How to create a SharePoint Online list with Power Automate

This is how we can create a SharePoint custom list and add columns to that specific list using Power Automate.

Conclusion

I hope you got some ideas to create a SharePoint online list using Power Automate Rest API. Moreover, we saw how to create various columns in the SharePoint list using Power Automate with examples.

Also, you may like: