How to Copy New Files from Your PC to SharePoint using Power Automate?

Recently, I was working on Power Automate flows when one of our clients required me to copy files from my PC to the SharePoint document library.

In this blog post, I will discuss how to connect an on-premises gateway to connect the file system to SharePoint. Also, I will show copying files from the local drive to SharePoint using the Microsoft flow template.

Power Automate Flow to Copy from Local Drive to SharePoint

Here, I have a folder on my PC, and I want to transfer those files to a SharePoint document library.

I have created a SharePoint document library and a folder called ‘Employee Details’ inside it.

Look at the image below:

Transfer files to SharePoint Power Automate

Now, let’s create the Power Automate flow.

1. Sign in to your Microsoft 365 Account -> Open the Power Automate Home page by browsing make.powerautomate.com in the browser.

  • Click on Templates -> Search and select “Copy new files from your PC to SharePoint“ template.
Power Automate copy data to SharePoint online from box

2. Once we selected the template, the prebuilt flow will be added to the Power Automate canvas, as shown in the below image:

Power Automate copy from box to SharePoint Online

3. To copy files from your PC to the SharePoint Online library, you need to create a new Data gateway connection for your PC.

Click on the context menu “” option -> “ +Add new connection,” as shown in the screenshot below.

Power Automate Transfer files to SharePoint Online from box

4. Then, the File system box will display where we need to connect and enter the PC details.

  • Connection Name: Enter a connection name for your PC without any space.
  • Root Folder: Provide the folder path where you want to copy files to the SharePoint library.

Right-click on the created folder -> select Copy as a path -> Paste it in the Root folder -> Remove the double quotes from it.

Power Automate copy data from box to SharePoint Online
  • Authentication Type: Select the Authentication Type as “Windows” from the dropdown.
  • Username: Enter the Username of your PC with DOMAIN\Username.

If you are not aware of your PC username -> Go to Search -> Select Command Prompt -> Type whoami without space -> Then, it will give the domain and username as look like below:

Power Automate copy files to SharePoint Online from box
  • Password: Provide a password for Outlook that you have signed in to your PC.
  • gateway: Select the gateway for your PC connection.
Copy from local drive to SharePoint Power Automate

Once all the field values are filled, Click on “Create,” as shown below.

How to copy files from local drive to SharePoint Power Automate

5. Then, in the trigger, copy and paste the folder path from where it will transfer the files to the SharePoint list shown below:

Copy box to SharePoint using Power Automate

6. Under the Apply to each loop, click on context menu of Get file content and select a connection.

Copy new files from your PC to SharePoint Power Automate

7. Inside the Create file flow action, set the parameters like Site Address and Folder Path from the show picker icon.

Refer to the image below:

Power Automate Transfer files to SharePoint

Once the flow is ready, click on save and test the flow.

8. Now, add or create a file in the folder we have created. I have created a folder named ‘Employee Data’, as shown in the figure below.

Power Automate copy files from files system to SharePoint

8. Now, the flow will trigger and copy the files to the Share Document library, as shown in the image below:

Power Automate copy file to SharePoint

This way, you can copy files from the local drive from the PC to the SharePoint library using Power Automate.

How to Download and Install On-Premises Data Gateway

If you are new to File system connector, then you don’t have any data gateway connection. We need to install a new on-premise data gateway from the dropdown using the “+ New on-premises data gateway” option.

Steps for On-premises data gateway installation:

A. Use the provided link to download the On-premises data gateway. Click on the Download button -> Then it will download the file with the extension like below:

Power Automate copy files to SharePoint from box

B. Open the file, then it will display the On-premises data gateway installation box-> Click on the check box if I accept the terms -> Select Install.

Move files to SharePoint Online from box Power Automate

C. In the next window, it will install the gateway in a few seconds, as shown in the picture:

Power Automate File system to SharePoint

D. When the installation is successful, it will ask for an Email address to use this gate way, Provide the Microsoft365 account username -> Click on Sign in.

Power Automate Copy files from box to SharePoint Online

E. In the next window, enter the password and click on Sign in.

Power Automate copy files to Microsoft 365 from box

F. After signing in with the user account, select Register a new gateway on this computer option -> Click Next.

Copy files to Microsoft 365 from box Power Automate

G. Next, provide a name for the new on-premises data gateway, set the Recovery Key, and Choose Configure.

Power Automate copy from local drive to SharePoint

H. Then, it will show that the new on-premises data gateway is ready to be used, as displayed in the screenshot below:

How to copy files from PC to SharePoint Power Automate

This is how to download and install the On-premises data gateway.

Conclusion

I hope this tutorial blog will help you better understand how to copy files from your PC to SharePoint using Power Automate.

You may also like:

  • Is it possible to schedule flows to run at a specific time?
    I have a file, which takes about 1hr to load. It is not big but takes a long time to finish. Power flow fails to upload it.

  • >