Power Automate Create Document Library

In this Power Automate tutorial, we will discuss Power Automate creating document Libraries. We will see here, Power automate create document library with a few examples. And also we will discuss the below points:

  • Power Automate create a document library
  • Power Automate create a folder in a document library
  • Power Automate create a file in a document library
  • Power Automate create a link in a document library
  • Power Automate create add column document library

Power Automate create a document library

Here we will see how to create a document library using Power Automate.

As we don’t have an action to create a document library, we will use HTTP requests to create a document library.

In Power Automate, select the Manually triggered Flow, then click on the Next step.

power automate create document library
power automate create a document library

Next, we will create a document library in SharePoint using an HTTP request. So click on the Next step and select Send an HTTP request to SharePoint action. Then Provide the site address and Method as Post.

Next, provide the below information:

Uri : _api/web/lists/

Headers:

{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body:

{  
   'AllowContentTypes': true,   
   'BaseTemplate':101,   
   'ContentTypesEnabled':true,  
   'Description':"",   
   'Title': 'Invoice'  
}  
How power automate create document library
How power automate create a document library

Now click on Save and run the flow manually and you can see a Document library get created in SharePoint.

Microsoft Flow create document library
Microsoft Flow create a document library

This is an example Power automate create a document library.

Read Power Automate Create SharePoint List

Power Automate create folder in document library

Here we will see how to create a folder in the document library using Power Automate.

Here we have a SharePoint list called Employee list, so when we add a new name, it will create a folder in the Document library using an HTTP request.

power automate create folder in document library
power automate create a folder in a document library

Document Library:

Microsoft Flow create folder in document library
Microsoft Flow create a folder in a document library

In Power Automate, select the trigger ‘When an item is created‘ action. Then provide the site address and list name.

Microsoft Flow create folder in SharePoint document library
Microsoft Flow create a folder in the SharePoint document library

Now we will create a folder in the SharePoint Document Library with HTTP requests. So click on the Next step and select Send an HTTP request to SharePoint action. Then provide the site address, Method as post, and provide the below information:

Uri : _api/web/GetFolderByServerRelativePath(decodedurl='Employee Details')/Folders

Headers:

{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body:
{ '__metadata': { 'type': 'SP.Folder' }, 'ServerRelativeUrl': 'Employee Details/@{triggerOutputs()?['body/Title']}'}
Power Automate create folder in SharePoint document library
Power Automate create folder in SharePoint document library

Now click on Save and to run the flow create an item in the SharePoint list, after that you can see a folder get created with the employee name.

How Power Automate create folder in SharePoint document library
How Power Automate create folder in SharePoint document library

This is how to create a folder in a document library using Power Automate.

Read Power Automate create an HTML table from SharePoint List

Power Automate create file in document library

Here we will see how to create a file in the Document library with an HTTP request.

We have a Library called Employee details, so here we will create a file with HTTP requests.

power automate create file in document library
power automate create a file in a document library

In Power Automate, select the Manually triggered Flow, then click on the Next step.

How power automate create file in document library
How power automate create a file in a document library

Now we will create a file in the SharePoint Document library, so click on the Next step and select Send an HTTP request to SharePoint action. Then Provide the site address, Method as Post and provide the below information:

Uri: _api/web/GetFolderByServerRelativeUrl('Employee Details')/Files/add(url='Emp.txt',overwrite=true)

Header:
{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}
Microsoft FLow  create file in document library
Microsoft Flow create a file in the document library

Now click on Save and run the Flow manually and you can see the file get created in the document library.

MS FLow  create file in document library
MS FLow create file in document library

This is an example of how to create a file in a document library in Power Automate.

Read Power Automate send an email with an attachment from SharePoint

Here we will see how to create a shareable link in the document library using Power Automate.

In Power Automate, select the Manually triggered Flow, then click on the Next step.

power automate create link in document library
power automate create a link in a document library

Now we will create a file in the document library, so select Create File action. Then provide the site address, folder path, file name, and file content.

How power automate create link in document library
How power automate create a link in a document library

Now we will create a Shareable link for the created file, then click on the next step and select Create sharing link for a file or folder action. Then provide the site address, library name, item id from dynamic content, Link type as view and edit, and Link scope as People and organization from option.

Microsoft Flow create link in document library
Microsoft Flow create a link in a document library

Now we will update the shareable link in the Link column, so click on the Next step and select Update file properties, then provide the site address, library name, id from dynamic content, and in the link column provide the sharable link from dynamic content.

How Microsoft Flow create link in document library
How does Microsoft Flow create links in a document library

Now click on Save and run the flow manually and you can see a file get created with the Shareable link.

MS Flow create link in document library
MS Flow create link in document library

This is how to create a link in a SharePoint document library using Power Automate.

Read Power Automate update SharePoint list item

Power automate create add column document library

Here we will see how to create multiple columns in the document library using Power Automate.

So here we have a document library called Invoice documents, in this document library, we will create multiple columns.

 power automate create add column document library
power automate create add column document library

In Power Automate select the Manually triggered Flow, then click on the Next step.

Microsoft Flow create add column document library
Microsoft Flow create add column document library

Next, we will create an Array of columns, so click on the Next step and select Initialize variable action. Then provide the variable name, type as an array, and in value add the column like below

[
"Category",
"Quantity"
]
How MS Flow create add column document library
How MS Flow create add column document library

Now we will create an item in the SharePoint Document Library using an http request. So click on the Next step and select Apply to each action, then provide the variable in output.

Then click on add an action, and select Send an Http request to SharePoint action. Then provide the site address, method as Post, and then provide the below information:

URI : _api/web/lists/GetByTitle('Library name')/fields

Header:

{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body:

{
 '__metadata': 
{ 'type': 'SP.Field' }, 
"Title":"@{items('Apply_to_each')}",
"FieldTypeKind": 2
}
MS Flow create add column document library
MS Flow create add column document library

Now click on Save and run the Flow manually. After that click on add column, then click on Show and hide column and select the column you created.

Flow create add column document library
Flow create add a column document library

Related Power Automate tutorials:

This is an example of how to create a column document library using Power Automate. In this Power Automate tutorial, we learned Power Automate create a document library. And also we will discuss the below points:

  • Power Automate create a folder in a document library
  • Power Automate create a file in a document library
  • Power Automate create a link in a document library
  • Power Automate create add column document library
  • Can any of these steps be used to create a new view in a current library? Looking for a way for a user to complete a simple form which will be used as the basis for setting up a new site page along with creating a new folder in the library. On the site page I’m hoping to include a library webpart which would be filtered to only show items with the project title. Hoping I’d be able to use power automate to create the filtered view.

  • >