Create SharePoint Online List using Power Automate [And Add Different Types of Columns]

In this Power Automate or Microsoft flow tutorial, we will see, how to create a SharePoint list using Power Automate. Once we have created the list, then we will also add different types of columns, like Single lines of text, Choice, and Multiples lines of text using Power Automate.

Here we will create a SharePoint list of ‘Project’ and add the below columns using Power Automate ‘Send an HTTP request to SharePoint’ flow action:

  • Project Name- Single line of text
  • Status- Choice(“Completed”, “Pending”, “Not Started”)
  • Description- Multiples line of text

The flow looks like the below:

Create a SharePoint Online List using Power Automate
create a SharePoint list using rest API in Power Automate

Send an HTTP request to SharePoint is an action in Power Automate, that is used to communicate with the SharePoint resources by using SharePoint Rest API.

With this action, we can perform CRUD operations (create, read, update, and delete)items in the SharePoint library and list.

Download Complete Solution With Additional Columns from Excel

We have also created a modified version of the Power Automate flow, where you can create different types of columns like below. Also, in this, you can create as many columns from an Excel file.

  • Single line of text
  • Choice
  • Number
  • Person
  • DateTime
  • Yes/No
  • Hyperlink

Create a SharePoint list using Power automate

Here we will how to create a SharePoint list and add columns using Power Automate/Microsoft Flow.

To create a SharePoint list and multiple columns, we will see how to use the “Send an HTTP request to SharePoint” flow action.

To create this Power Automate flow follow the below steps:

Step 1: Create a Flow in Power Automate

Now we will create a flow that will manually trigger, with a button click in Power Automate, and it will create a SharePoint list and multiple columns.

So, Login to Power Automate, click on the +Create icon, from the navigation menu, and then select Instant cloud flow.

Create a SharePoint list using Microsoft Power Automate
Create a SharePoint list using Microsoft Flow

Step 2: Provide Flow name

Now we will provide the Flow name, and then select the Manually trigger a flow. Then click on Create button.

using Microsoft Flow Create a SharePoint list
using Microsoft Flow Create a SharePoint list

Step 3: Create a SharePoint list

To create a SharePoint list using Power Automate, we need to use the ‘Send an HTTP request to SharePoint‘.

See also  Power bi measure subtract + 7 useful examples

Click on ‘+New Step‘ -> select the operation as ‘Send an HTTP request to SharePoint‘ like below:

Send an HTTP request to SharePoint
Send an HTTP request to SharePoint

Next, click on the More icon and then click on Rename, and provide the name ‘Send an HTTP request to SharePoint (Create a list)’.

Create a SharePoint Online list using Microsoft Flow
Create a SharePoint Online list using Microsoft Flow

Here it will ask the below things:

  • Site Address: Select or provide the SharePoint Online site address
  • Method: Select POST, we are creating a list.
  • Uri: Provide the Uri as _api/web/Lists/ as we are doing list operations.
  • Headers: Provide like the below code example (There are required while you are calling a rest API call)
  • Body: Provide like the below code example (There are required while you are calling a rest API call). Here I have provided BaseTemplate as 100, as we are creating a custom list.

Then select the SharePoint site address, where you want to create a SharePoint list. Choose the Method as ‘Post’. Then provide the Uri, Header, and Body.

Uri - _api/web/Lists/
Headers:
{
  "content-type": "application/json;odata=verbose",
  "accept": "application/json;odata=verbose"
}

Body:

{ '__metadata': { 'type': 'SP.List' }, 'AllowContentTypes': true,
 'BaseTemplate': 100, 'ContentTypesEnabled': true, 'Description': 'My list description', 'Title': 'Project' }
Create a list in SharePoint using flow
Create a list in SharePoint using flow

After this step, the SharePoint list will get created, next, we will add the columns.

Step 4: Create a ProjectName column

To create our first column in the SharePoint list ‘Project’, for this, we need to create an operation ‘Send an HTTP request to SharePoint ‘.

Click on ‘+New Step‘ -> select the operation as ‘Send an HTTP request to SharePoint‘.

Send an HTTP request to SharePoint
Send an HTTP request to SharePoint

Here it will ask the below things:

  • Site Address: Select or provide the SharePoint Online site address
  • Method: Select POST, we are creating a column.
  • Uri: Provide the Uri as _api/web/Lists/getByTitle(‘Project’)/fields, as we are doing field operations.
  • Headers: Provide like the below code example (There are required while you are calling a rest API call)
  • Body: Provide the below code example (There are required while you are calling a rest API call). Here we have passed the field type as ‘SP.FieldText’ and FieldTypeKind as 2, as this column is a Single line of text. At last, provide the column title as ‘Project name’

Then select the SharePoint site address, where you want to create a SharePoint list. Choose the Method as ‘Post’. Then provide the Uri, Header, and Body.

Uri - _api/web/Lists/getByTitle('Project')/fields
Headers:
{
  "content-type": "application/json;odata=verbose",
}

Body:

{
"__metadata": {
          "type": "SP.FieldText"
        },
        "FieldTypeKind": 2,
        "Title": "Projectname"
},
Create a list in SharePoint using MS flow 1
Create a list in SharePoint using MS flow

Step 5: Create a Status column

See also  The database engine instance you selected is not valid for this edition of reporting services

To create our second column ‘Status’ which has three choices'”Completed”, “Pending”, and “Not Started”‘ in the SharePoint list ‘Project’, for this, we need to create an operation ‘Send an HTTP request to SharePoint ‘.

Click on ‘+New Step‘ -> select the operation as ‘Send an HTTP request to SharePoint‘.

Send an HTTP request to SharePoint
Send an HTTP request to SharePoint

Here it will ask the below things:

  • Site Address: Select or provide the SharePoint Online site address
  • Method: Select POST, we are creating a column.
  • Uri: Provide the Uri as _api/web/Lists/getByTitle(‘Project’)/fields, as we are doing field operations.
  • Headers: Provide like the below code example (There are required while you are calling a rest API call)
  • Body: Provide the below code example (There are required while you are calling a rest API call). Here we have passed the field type as ‘SP.FieldChoice’ and FieldTypeKind as 6, as this column is a Choice. And, provide the column title is a display name ‘Project name’. Then provide the choice as metadata information, the type of the choice collection is “Collection(Edm. String)”. At last pass the choices in the results.

Then select the SharePoint site address, where you want to create a SharePoint list. Choose the Method as ‘Post’. Then provide the Uri, Header, and Body.

Uri - _api/web/Lists/getByTitle('Project')/fields
Headers:
{
  "content-type": "application/json;odata=verbose",
}

Body:

{
"__metadata": {
          "type": "SP.FieldChoice"
        },
        "FieldTypeKind": 6,
        "Title": "Status",
        "Choices": {
          "__metadata": {
            "type": "Collection(Edm.String)"
          },
          "results": [
            "Completed",
            "Pending",
            "Not Started"
          ]
        }
}
Create a list with multiple columns in SharePoint using rest api
Create a list with multiple columns in SharePoint using rest api

Step 6: Create a Description column

To create our second column ‘Description’ which is a Multiline text type in the SharePoint list ‘Project’, for this, we need to create an operation ‘Send an HTTP request to SharePoint ‘.

Click on ‘+New Step‘ -> select the operation and then select the operation as ‘Send an HTTP request to SharePoint‘.

Create a Sharepoint online list using power Automate
Create a Sharepoint online list using power Automate

Here it will ask the below things:

  • Site Address: Select or provide the SharePoint Online site address
  • Method: Select POST, we are creating a column.
  • Uri: Provide the Uri as _api/web/Lists/getByTitle(‘Project’)/fields, as we are doing field operations.
  • Headers: Provide like the below code example (There are required while you are calling a rest API call)
  • Body: Provide the below code example (There are required while you are calling a rest API call). Here we have passed the field type as ‘SP.FieldMultiLineText’ and FieldTypeKind as 3, as this column is a Multiples line of text. And, provide the column title is a display name ‘Description’. Whereas ‘NumberOflines’ is the number of lines allowed for input in the multi-line of text.
See also  How to use bootstrap in SPFx webpart

Then select the SharePoint site address, where you want to create a SharePoint list. Choose the Method as ‘Post’. Then provide the Uri, Header, and Body.

Uri - _api/web/Lists/getByTitle('Project')/fields
Headers:
{
  "content-type": "application/json;odata=verbose",
}

Body:

{
      "__metadata": {
        "type": "SP.FieldMultiLineText"
      },
      "FieldTypeKind": 3,
      "Title": "Description",
      "NumberOfLines": 6
    }
Create a SharePoint list with multiple columns using Power Automate
Create a SharePoint list with multiple columns using Power Automate

Step 7: Run the Flow

To run the flow, click on Save and then click on the Test icon -> choose Manually -> click on Test. Then it connects with the connector using the credential, if it is done click on the ‘Run Flow‘ button.

Next Run Flow window will open and it will show the message ‘ Your flow run successfully started.’ Then click on Done.

Using Miscrosft flow create SharePoint list
Using Microsoft flow create SharePoint list

Next, you can see the successful message, if there is no error. you can see the SharePoint list is created on the provided SharePoint site.

Create a SharePoint Online list using Power Automate
Create a SharePoint Online list using Power Automate

Open the SharePoint list ‘Project’ from Site Contents, and click on Settings -> click on List settings. You can see the columns created, under the Columns section.

Using power automate create a SharePoint Online list
Using power automate create a SharePoint Online list

This is how we can create a SharePoint list with multiple types of columns using Rest API in Power Automate.

Conclusion

In this Power Automate tutorial, we saw how to create a SharePoint list in a SharePoint site using Power Automate/Microsoft Flow. Also, we saw how to create columns like Single lines of text, Multiple lines of text, and Choice types to the SharePoint list.

You may also like:

>