Combatting File System Frustration in Power Automate

The first time I ever worked with file system actions in Power Automate, I spent 2 hours trying to get the flow to run correctly. It was infuriating. I struggled that long because the errors shown had nothing to do with the actual problem. Also, Microsoft has some conventions that can lead you down the wrong path. Read this post before using File System actions to avoid major roadblocks.

Let’s start with how to use and configure file system actions. For this example, I will configure a Create file action.

How to Use File System Actions

  1. Click on the Add action or New Step button in Power Automate. Type in File System to search for File System actions.  Then search for or click on Create file.
  2. If this is your first time using file system actions, the action default to the screenshot show in step 3 whereby you must create a connection. If you have existing connections, click on the three dots and select the appropriate connection.
  3. Create a new connection. Give the connection a name that will indicate where you are connecting to. You might have more than one connection eventually. If you connect to a network drive, the root folder will start with “\\”, as opposed to connecting to a “C:\” drive as shown. It does not matter if you end the file path with a slash, such as \\companyfile\shared\”. Do not use mapped drive paths, like “D:\”. Additionally, if you work with a shared drive structure, you only need to configure the root drive, which might look like “\\companyfile\shared\” instead of a longer pather with more subfolders. You will still be able to connect to subfolders. Windows authentication is the only option in my drop down. The username must be preceded by a domain name, like “abc\jsebby”. Without the domain, Power Automate will give you a nonsensical error. Each company will have a different gateway set up, so choose according to what is set up for your company. For more information on gateways, check out this link. The linked content uses the term “on-premise” frequently. On-premises means hosted on-site, as opposed to stored in the cloud.
  4. Then, configure the File System file path. Enter the full file path for where you want to connect in Folder path. For the file name, you may type in the name of the file or use dynamic content.  In this case, I am saving an attachment from an email, and I take the file name that came thru with the email. For file content, you will likely need to use dynamic content. In this case, my email trigger provided dynamic content for the file contents that came thru with the email.

Troubleshooting File System Actions

If you run into this error, it appears as if the problem is related to a bad file path. The Error Details window shows a forward slash before the file name. However, this problem is not related to the file path, and that forward slash doesn’t really exixt. The problem is the connection setup. More specifically, the username doesn’t have a domain associated with it (see step 3 above).

We can confirm the error is caused by a bad connection by clicking on the folder icon in the top right-hand corner of the action, to the right of the file path.  When you click on the folder and attempt to navigate thru the folder structure, this will produce an error that tells us the connection isn’t connecting. 

When creating the connection, you must include the domain name before the user name.  This error might also present itself if/when the password was incorrect or had been changed. 

Helpful Tips For File System Actions

Tip No 1

You cannot convert file types with the Create file action. If you need to convert the file type, this must be done in some other way, such as with Power Automate Desktop, which I wrote about in this post.

Tip No 2

If you are troubleshooting an error and you happen to click on Show Raw Inputs in the Create File action, it will appear as if there are extra slashes in the file path.  This is a Microsoft convention.  This is not wrong. Just ignore this. I don’t know why MS does this. If you do, please leave me a comment, and I’ll update the post.

Okay, that wraps up this post on learning to use file system actions in Power Automate. Hopefully, I’ve saved at least a few people the same struggles I experienced when working with file system actions.

Other Sweet Power Automate Content

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.