In this “Upload multiple files in SharePoint using Power Automate” article, we will learn how quickly we can upload multiple files (more than 5000) in the SharePoint Online document library.
If we want to test the SharePoint document library threshold limit issue, we need to have a document library with more than 5000 documents. So, in this Power Automate flow, we will learn how to create multiple files very quickly.
Upload multiple files in SharePoint using Power Automate
Before getting into the Power Automate, let’s talk about the prerequisites.
Prerequisites: Upload multiple files in SharePoint
As part of the prerequisites, perform the below:
- Create a document library called “UploadMoreThan5KDocuments.”
- Create a folder named “Template.”
- Manually upload the sample file named “TemplateFile.docx.”
- Optional: Create a choice type column named “ItemCreatedChannel” with the value “Manual” or “Power Automate”

Power Automate: Create multiple files in SharePoint
Below is the Power Automate flow that will create multiple files in the SharePoint Online document library.

This is a manually triggered flow. It has two sections:
- Variable declaration
- Do Until Loop
Variable declaration section: Create multiple files in SharePoint
Initialize below two variables:
- intVarItemCount – Integer Type with initial value 1. This number is the starting number of the loop.
- strVarItemTitleToBeCreated – String Type, This will be passed in the Name column as value.

Get file content using path in Power Automate
Add a “Get file content using path” action and pass the below parameters:
- Site Address: Your site URL
- File Path: Select your template file uploaded in the prerequisites section. This is the key template file; based on this file, other files will be created.

Do Until Loop Power Automate: Auto increment number in power automate to add multiple files in SharePoint
Below is the Do Until loop section.

Explanation of Do Until Loop Power Automate
Step 1:
Step 1:
@variables('intVarItemCount') is equal to 5000 In change limit, count is equal to 5000

Notes:
- The default change limit is 60, you must change to the desired number you want to create in the list.
- For example, we have given the number 5000, however, you could give any positive number which is less than or equal to 5000. More than 5000 numbers, will not accept.
- This number count control how many items should be created in the list.
- If you want to create more than 5000 items in the list, then you need to execute this flow more than once or you need to execute this in batch.
Step 2:
Add a compose action and add the “intVarItemCount” variable in it.
@{variables('intVarItemCount')}
Step 3:
Add compose action to convert the number to a string. Add the below value to the compose action.
string(outputs('Compose_-_Item_Sequence_Number'))
Add compose action to convert number to string
Step 4:
Add a set variable action for the “strVarItemTitleToBeCreated” variable. And using the Concat function add two strings (‘Item_’ and ‘incremented number).
concat('Document_',outputs('Compose_-_Convert_item_sequence_to_string'),'.docx')
The Concat function add two string in Power Automate
Note:
- Here we created the file name as “Document_1”, “Document_2”, and “Document_3”, etc. However, you could give some other values. Here the “Document_” part is fixed and the number part is dynamic (auto-incremented).
Step 5: Create file action in Power Automate
Add a “Create file” action and pass the below parameters:
- Site Address: Your site URL
- Folder Path: Select the document library path where you want to upload the files; here we have selected the document library root folder.
- File Name: Pass the file name from the previous step, “strVarItemTitleToBeCreated”
- File Content: Pass the body of the get file content using path or directly use this – @{body(‘Get_file_content_using_path’)}
Create file action in Power Automate
Step 6: Update file properties in Power Automate (Optional step)
Add an update file properties action and pass the below parameters:
- Site Address: Your site URL
- Library Name: Your document library name
- Id: Item ID from the previous step create file action or directly like use this – @{outputs(‘Create_file’)?[‘body/ItemId’]}
- Title (Optional): Here we have passed the title as “Document_ItemID”, for this we have passed as –
concat(‘Document_’,outputs(‘Create_file’)?[‘body/ItemId’])
- ItemCreatedChannel Value (Optional) – Select as Power Automate (it has two values, Power Automate and Manual)

Step 7: Final Step
Increment the “intVarItemCount” variable by 1. For that add increment variable action.

That’s it we are done with the flow. Now let’s run the flow manually as this type of manually triggered flow. Then, take a break, then see the status, you could see that 5000 documents have been created in the document library.
Create more than 5000 documents in SharePoint using Power Automate – Demo
We could see that 5000 documents have been created in the list ‘AddMoreThan5KDocuments’ library.

Summary: Add multiple Documents in SharePoint using power automate (upload files to SharePoint using Power Automate )
Thus, in this article, we have learned how to add multiple documents in the SharePoint Online document library using Power Automate by auto-incrementing numbers inside the do until loop. And also we have learned the below:
- How to use get file content using path action in Power Automate.
- How to use create file action in Power Automate.
- How to use get file properties in Power Automate.
See Also: Power Automate Tutorial
You may also like the below Power Automate tutorials:
- Quickly add multiple items in SharePoint list using power automate – more than 5000
- Best way to update SharePoint list with more than 5000 items using Power Automate
- 2 ways in SharePoint Online check in all files using Power Automate quickly
- Instantly Delete items from two list using Power Automate: Delete SharePoint list item based on another list
- Best way to Get SharePoint list with more than 5000 items using Power Automate
- Fastest way to create multiple items in a list using PowerShell CSOM – O365
- Walkthrough: Use Flow in PowerApps to upload files or return data tables