It’s quite common to parse files in Power Automate, especially in bulk. But to parse files, we don’t need to get the file into Power Automate. We can get the file’s metadata and use it to do the necessary actions. The Flow runs in a fraction of the time by using the “Get file metadata using path” action instead of the “Get File Content Using Path Action” or the “Get File Content Action.”
So let’s explore what the “Get file metadata using path” action can offer us.
Where to find it?
To get it for your OneDrive:
You need to expand and search for “OneDrive.” Or you can search for it in the search bar, but be careful not to select “OneDrive for Business.”
Select “Get file metadata using path”:
This is what it looks like:
OneDrive for Business
To get it for your OneDrive for business, it’s displayed in the preview, but if you can’t find it for some reason, expand and search for it.
Select “Get file content using path”:
Looks the same as before.
You can use it in 2 ways:
- Select the file by selecting the folder icon and going through your folders until you find the file you want.
- Build the path dynamically and add it to the “File” field:
Let’s look at the first case:
Looks good. Let’s copy and paste the path and see what we get:
Looks awesome also. I chose this example for a reason. I decided to do the same example as in the Get file metadata action to see the difference. You can build the path yourself and provide it to the “Get file metadata using path” action, and all will work out.
They have the same limitation as the “Get File Content Using Path Action” or the “Get File Content Action.” You can’t access files in a shared library. You can find here a workaround from the Power Automate Community.
Here are some things to keep in mind.
Name it correctly
The name is super important in this case since we’re getting the file by either calculating the path or having a defined static one. Always build the name so that other people can understand what you are using without opening the action and checking the details.
Always add a comment.
Adding a comment will also help to avoid mistakes. Indicate where the path comes from, for example, if it’s calculated and how. It’s important to enable faster debugging when something goes wrong.
Always deal with errors.
Have your Flow fail graciously when the file doesn’t exist and notify someone that something failed. It’s horrible to have failing Flows in Power Automate since they may go unlooked for a while or generate even worse errors. I have a template and a template that you can use to help you make your Flow resistant to issues. You can check all details here.
Back to the Power Automate Action Reference.