Power Automate Save File To A Local Drive

Power Automate Save File To A Local Drive

Power Automate can save a file to a local drive but there is a considerable amount of setup that must be done before hand. An on-premises data gateway must be installed on the local machine and a connection to the machine needs to be created in Power Automate. Then you must ensure the user account has access to the drive or fileshare. And of course, the machine that Powe Automate is using to save files must stay powered on in order for Power Automate to use it.

Table of Contents
• Introduction: The Save SharePoint File To Local Drive AutomationInstall The On-Premises Data Gateway For Power AutomateConfigure The On-Premises Data GatewaySetup File Storage Folders On The Local DriveDetermine User's The Domain And UsernameCreate A File System Connection In Power AutomateLocate The File In SharePoint Document LibrarySave A File To A Local Drive Using Power AutomateRun The Power Automate Flow To Save A File To A Local Drive




Introduction: The Save SharePoint File To Local Drive Automation

A Power Automate flow is used to get a PDF file from a SharePoint site and save it to a computer’s local drive.



Once the automation is run the file named Adatum1.pdf appears in the location C:\Invoices\Adatum folder.




Install The On-Premises Data Gateway For Power Automate

To connect Power Automate to a local drive we must install an on-premises data gateway. Go to the download page and to get the application.



Install the on-premises data way onto the computer where the local drive will be accessed.



After installation is completed input an email address to use with the gateway. This the user with this email address must have permissions to access the local drive.




Configure The On-Premises Data Gateway

The gateway is now installed on the machine but there are a few more configuration steps to perform. Choose the option to register a new gateway on the computer.



Give the on-premises data gateway a display name and fill-in the recovery key fields. Ensure the gateway region is mapped to the Power Automate region of the environment the automation will run in. and press the Configure button.



The on-premises data gateway is now ready to be used.




Setup File Storage Folders On The Local Drive

When we save a file to the local drive in Power Automate we will need to supply a folder location. Open Windows Explorer and create two new folders:

  • C:\Invoices
  • C:\Invoices\Adatum


Later on in the process we will be saving a file named Adatum1.pdf to the folder C:\Invoices\Adatum.




The Power Automate File System connector requires a username and domain. To get this information open up the Windows Command Prompt, type whoami, then press Enter. The domain\username appears on the screen. In this example the domain\username is mdcorp\mdevaney.




Create A File System Connection In Power Automate

The automation requires a File System connection to save files to the local drive. Open Power Automate and go to the Connections menu. Add a new connection.



Select the File System connector.



Input the following information in the connection parameters:

  • Root folder: C:\Invoices
  • Authentication Type: Windows
  • Username: domain\username
  • Password: **********
  • Eligible Gateway: Data Gateway 001




Locate The File In SharePoint Document Library

We want to save a file stored in SharePoint Document Library to a local drive. Place a PDF document in the Documents folder of a SharePoint site. In this example we using a file named Adatum 1.pdf.




Save A File To A Local Drive Using Power Automate

Now we are ready to build the Power Automate flow. Create a new instant flow and name is Save File To Local Drive.



Add a SharePoint – Get File Content action to the flow and select Adatum 1.pdf in the File Identifier field. Then insert a File System – Create file action. Choose the folder path C:\Invoices\Adatum, input Adatum 1.pdf as the file name and supply the file content from the previous action.




Run The Power Automate Flow To Save A File To A Local Drive

We’re done. Test the flow to ensure it works.



The file Adatum 1.pdf from SharePoint is now saved to the local drive




Questions?

If you have any questions or feedback about Power Automate Save File To A Local Drive please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion.

Matthew Devaney

Subscribe
Notify of
guest

0 Comments
Oldest
Newest
Inline Feedbacks
View all comments