Create Library

How to create a new SharePoint Online library using a Power Automate flow.

URI

_api/web/lists

Headers

{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}

Body

{
"__metadata": { "type": "SP.List" },
"AllowContentTypes": true,
"BaseTemplate": 101,
"ContentTypesEnabled": true,
"Description": "My library description",
"Title": "Manuals"
}

Screenshot with example

Sample data
Site Address – https://contoso.sharepoint.com/sites/PowerUsers
Title – Manuals

createlibrary

Copy/paste example

{"id":"025ddbf8-03b8-49e2-ad1e-d661ff0ca998","brandColor":"#036C70","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/exp_sharedsharepointonline_e5efa"}}},"connectorDisplayName":"SharePoint","icon":"https://connectoricons-prod.azureedge.net/releases/v1.0.1682/1.0.1682.3675/sharepointonline/icon.png","isTrigger":false,"operationName":"Send_an_HTTP_request_to_SharePoint","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"@parameters('SPOSiteCollection_PowerUsers (exp_SPOSiteCollection_PowerUsers)')","parameters/method":"POST","parameters/uri":"_api/web/lists","parameters/headers":{"Accept":"application/json;odata=verbose","Content-Type":"application/json;odata=verbose"},"parameters/body":"{ \n\"__metadata\": { \"type\": \"SP.List\" }, \n\"AllowContentTypes\": true, \n\"BaseTemplate\": 101,\n\"ContentTypesEnabled\": true, \n\"Description\": \"My library description\", \n\"Title\": \"Manuals\"\n }"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{}}}

Resources

Create a list

That’s it, Happy testing!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.