Requirement: Create SharePoint List and SharePoint document Library in SharePoint site using Send an HTTP Request Action in Power automate
Create Manually Trigger a flow, Add Text as SiteName,ListName,LibraryName.
![](http://rishandigital.com/wp-content/uploads/2023/05/image-210.png)
Add Initialize variable actions, Provide Name: SiteName, ListName, LibraryName and Add another Initialize variable action, which is to add Site URL and Site Name from previous declared variable.
![](http://rishandigital.com/wp-content/uploads/2023/05/image-211.png)
Add an Send an HTTP Request action, Create List for the provided site,
- Site Address: SiteURL from Initialize variable
- Method: POST
- Uri: /_api/web/lists
- Headers: Enter key-Content-Type , Enter Value-application/json;odata=verbose
Body:
{
"__metadata": {
"type": "SP.List"
},
"AllowContentTypes": true,
"BaseTemplate": 100,
"ContentTypesEnabled": true,
"Description": "@{variables('ListName')}description",
"Title": "@{variables('ListName')}"
}
![](http://rishandigital.com/wp-content/uploads/2023/05/image-212.png)
Add an Send an HTTP Request action, Create Library for the provided site
- Site Address: SiteURL from Initialize variable
- Method: POST
- Uri: /_api/lists
- Headers: Enter Key-Accept, Enter Value-application/json
Body:
{
"BaseTemplate": 101,
"ContentTypesEnabled": true,
"Description": " @{variables('LibraryName')}description",
"Title": "@{variables('LibraryName')}"
}
![](http://rishandigital.com/wp-content/uploads/2023/05/image-213.png)
Add Scope action, Add 3 Send an HTTP Request Action to add fields in the list.
- Field1-
- Site Address: Site URL(initialize variable) from dynamic content
- Method: POST
- Uri: _api/lists/getbytitle(‘ListName(from dynamic content)’)/fields
- Headers: Enter Key- Content type, Enter value- application/json;odata=verbose
- Field2-
- Site Address: Site URL(initialize variable) from dynamic content
- Method: POST
- Uri: _api/lists/getbytitle(‘ListName(from dynamic content)’)/fields
- Headers: Enter Key- Content type, Enter value- application/json;odata=verbose
- Field3-
- Site Address: Site URL(initialize variable) from dynamic content
- Method: POST
- Uri: _api/lists/getbytitle(‘ListName(from dynamic content)’)/fields
- Headers: Enter Key- Content type, Enter value- application/json;odata=verbose
Field1- Body:
{
"__metadata": {
"type": "SP.Field"
},
"Title": "Integer Field",
"FieldTypeKind": 9
}
Field2- Body:
{
"__metadata": {
"type": "SP.Field"
},
"Title": "Name Column",
"FieldTypeKind": 2
}
Field3- Body:
{
"__metadata": {
"type": "SP.Field"
},
"Title": "Currency Column",
"FieldTypeKind": 10
}
![](http://rishandigital.com/wp-content/uploads/2023/05/image-214.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-215.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-216.png)
Now Save and Run the flow. Add SiteName from Site URL , SharePoint listname, SharePoint libraryname.
![](http://rishandigital.com/wp-content/uploads/2023/05/image-217.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-218.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-219.png)
Now Check the list and library created in the Site and fields in the list.
![](http://rishandigital.com/wp-content/uploads/2023/05/image-221-1024x486.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-220.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-222-1024x518.png)