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:
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.
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.
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‘.
Click on ‘+New Step‘ -> select the operation as ‘Send an HTTP request to SharePoint‘ like below:
Next, click on the More icon and then click on Rename, and provide the name ‘Send an HTTP request to SharePoint (Create a list)’.
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' }
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‘.
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"
},
Step 5: Create a Status column
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‘.
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"
]
}
}
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‘.
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.
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
}
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.
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.
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.
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:
- How to Parse JSON Object to Array in Power Automate
- Power Automate Condition if a String is Empty
- How to Check If a Date is Blank in Power Automate?
- Power Automate Apply to Each Current Item
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.