How to Copy File From Network Drive to SharePoint Using Power Automate?

Last week, I was working on a file migration task when I received a requirement to copy files from a network drive to SharePoint using Power Automate. The challenge was to automate the transfer process so that files from the network drive could be seamlessly moved to a SharePoint document library.

Since Power Automate doesn’t directly support network drives, I used a workaround by utilizing a local gateway and folder actions to access the network drive files. This allowed the automation to copy and upload the files to the desired SharePoint location.

In this tutorial, I will explain how to copy files from the local desktop folder to the SharePoint library and how to copy files from SharePoint to a local drive using Power Automate.

Copy a File From the Local Desktop Folder to the SharePoint library using Power Automate

This example will create a flow that copies the file from the local desktop folder to the SharePoint library.

For this example, I created a SharePoint document library named Source Documents.

How do I move files from desktop to SharePoint Power Automate

Now follow the below steps:

1. Create an automated cloud flow. Give the flow name and select the trigger When a file is created (properties only) from the File system action.

copy files from one sharepoint site to another

Now change the connection and add a new To provide the below data:

  • Connection Name: Name of the connection
  • Root Folder: The folder path of the local network drive.
  • Authentication type: Windows
  • Username: Provide machine name/ Administrator name(personal) or domain/ username (if you do know, in the cmd, type whoami).
  • Password: Provide the password
  • Gateway: Choose the gateway or install the gateway.
Power Automate copy document library to another sharepoint site

Then, provide the root folder by clicking on the folder icon.

Power Automate copy data to sharepoint online from box

2. Add the ‘Get file content’ action from the File System connector, provide the file path using dynamic content, and click on ‘Show advanced options.’ Then, in the ‘Infer Content Type’ field, select ‘Yes.’

Copy files and folders to sharepoint online using power Automate

3. I want the file to be created in the SharePoint library. Add the ‘Create File‘ action from the SharePoint Online connector. Then, use dynamic content to provide the site address, folder path, file name, and file content.

Copy file from desktop to Sharepoint library in Power Automate

Now click on Save and run the Flow manually. Once the flow runs, add a file to the local network drive.

Power Automate Move or copy files to SharePoint

After the flow runs successfully, go to the SharePoint documents library, and you will see the same file successfully copied from the local desktop to SharePoint.

Power Automate How to auto copy or move files

You can copy a file from the local desktop folder to the SharePoint library using Power Automate.

Copy Files from SharePoint to a Local Drive using Power Automate

In the previous example, we saw how to copy a file from the local desktop to SharePoint. Now, I’ll explain how to copy a file from SharePoint to the local desktop using Power Automate.

Now follow the below steps:

1. Create an automated cloud flow. Give the flow name and select the trigger When a file is created (properties only).  Also, provide the Site Address and Library Name.

Copy Files from SharePoint to a Local Drive using Power Automate

2. Add a Get file content using path action for SharePoint from action and Provide the required parameters:

  • Site Address: Select the SharePoint site address from the dropdown where the file exists.
  • File Path: Provide the full path from dynamic content for when a file is created.
Copy Files from SharePoint to a Local Drive in Power Automate

3. Now, I need to create a file on the local drive, so I added the ‘Create file’ action using the File System connector. Then, I provided the folder path, file name, and file content from the dynamic content.

Power Automate Copy Files from SharePoint to a Local Drive

Now click on Save and run the Flow manually. Once the flow runs, add a file to the SharePoint document library.

power automate copy file from local drive to sharepoint

After the flow runs successfully, go to the local desktop folder, and you will see that the same file has been successfully copied from SharePoint.

How to Copy Files from SharePoint to a Local Drive using Power Automate

In this tutorial, I explained how to automate file transfers between a local desktop folder and SharePoint using Power Automate and how to copy a file from SharePoint to the local desktop using Power Automate.

Related Power Automate tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…