Copy new files from your PC to SharePoint using Microsoft Flow

In this Microsoft Flow tutorial, we will discuss how we can use “Copy new files from your PC to SharePoint” Microsoft Flow Template in SharePoint Online Office 365. By using this Microsoft Template, You can copy any files from your PC to SharePoint Online List/Document Library.

If you are new to Microsoft Flow, then read a detailed article on Microsoft Flow:

Microsoft Flow copy file from pc to SharePoint Online Document Library

To create Microsoft Flow in SharePoint Online Office 365, First, Sign in your Office 365 Microsoft Account. Once it will open, Click on “App launcher” and then “Flow“.

Check Out Microsoft Flow and PowerApps Training Course Videos (Lifetime Access)

Microsoft flow
SharePoint-Applauncher

In the Microsoft Flow page, Go to “Templates” which is present in the left navigation. Search the Microsoft Flow Template name as “Copy new files from your PC to SharePoint“. Then you can get your flow template as shown below screenshot. Just click on that template.

Copy new files from your PC to SharePoint using microsoft flow
Copy new files from your PC to SharePoint

In this template, you can see the there is an action present (By default) which name as: “When one or more files are added or modified (metadata only)“.

At first, To copy a file from your PC to SharePoint Online List/Library, You need to create a new Data gateway connection for your PC. To create a new connection, Click on “” option and “+Add new connection” as shown in the given below screenshot.

microsoft flow sharepoint copy file action
microsoft flow sharepoint copy file action

Once you will click on “+Add new connection“, a File System action will appear where you have to enter about your PC details. This action has below fields:

  • Connection Name: Provide a connection name for your PC.
  • Root folder: Give your Root folder path where you will create the file.
  • Authentication Type: Select the Authentication Type as “Windows” from the dropdown.
  • Username: Enter the Username of your PC as like: “TSINFO\Administrator“.
  • Password: Provide your PC Password.
  • gateway: Select a data gateway for PC Connection. If you don’t have any data gateway connection, then install a new on-premise data gateway from the dropdown using the “Install a gateway” option.

NOTE: For On-premises data gateway installation, you may follow the below article:

Once all the field value will over, Click on “Create” as shown in below.

flow copy file to sharepoint
flow copy file to sharepoint

This “When one or more files are added or modified (metadata only)” action is having one type of field as:

  • Folder (Mandatory): Specify the path of your folder where you will create the file.
Copy new files from your PC to SharePoint in flow
Copy new files from your PC to SharePoint in flow

Once you will finish the first action field, you can see there is another action will be present (By default) next to the “When one or more files are added or modified (metadata only)” action. The action name is: “Get file content” which is having one mandatory field as:

  • File: Select “List of Files Id” from the dynamic content (By default, It was selected).
Copy new files from your PC to SharePoint in microsoft flow
Copy new files from your PC to SharePoint in microsoft flow

Similarly, you can see there is one another action will be present (By default) next to the ” Get file content ” action. The action name is: “Create file” which helps to create a file in the SharePoint Online List/Document Library. This action is having two mandatory fields as:

  • Site Address: Enter your Site Address URL where you the file will copy from your PC.
  • Folder Path: Specify your folder path where you will create/add a file.
    You can also specify your folder path from the folder box. For this example, My SharePoint Online folder path is “/Shared Documents“.
  • File Name: Enter the name of the file from the dynamic content as “List of Files DisplayName“. Also, you can enter the file name by using your custom value.
  • File Content: Enter the content of the file from the dynamic content as “File Content“. Also, you can enter the file content by using your custom value.
Copy new files from PC to SharePoint in microsoft flow
Copy new files from PC to SharePoint in microsoft flow

In this below screenshot, you can see the full structure of Microsoft flow template (Copy new files from your PC to SharePoint). Once all things will over, Click on “Save“. Now click on “Flow Checker” whether there is an error or not and if not, then “Test” the flow as shown in below figure.

Copy new files from your PC to SharePoint flow
Copy new files from your PC to SharePoint flow

To test the flow for the first time, Select the option as: “I’ll perform the trigger action” and click on “Test” as like below screenshot.

Microsoft flow Copy new files from your PC to SharePoint
Microsoft flow Copy new files from your PC to SharePoint

To test the flow, it will ask you to add/create the files in your specified folder path. As in this example, I have specified the folder path as “G:/SharePointDocument“. So I have created a file in that same specified folder which you can see as shown in the below figure.

flow Copy new files from PC to SharePoint
flow Copy new files from PC to SharePoint

Once you will create/add a file in the specified folder path, then your flow run will complete successfully and you can see a status message as like below screenshot.

Microsoft flow Copy new files from PC to SharePoint
Microsoft flow Copy new files from PC to SharePoint

Now go to your specified SharePoint Online Document Library and refresh that page. You can see that your file is copied from SharePoint Library to your PC.

For this example, As I have specified my SharePoint Document Library path as “/Shared Documents”, So the new file is copied from PC to this SharePoint Online Shared Documents Library which you can see in the below figure.

Copy new file from your PC to SharePoint
Copy new file from your PC to SharePoint

You may like following SharePoint tutorials:

Hence, In this Microsoft Flow tutorial, We discussed a Microsoft Flow demo on Copy new files from your PC to SharePoint using Microsoft Flow template in SharePoint Online Office 365. Hope this will be helpful.

  • 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.

  • >