How to Get File Content using Path in Power Automate (SharePoint & OneDrive)

This Power Automate tutorial will teach us how to get file content using a path in Power Automate flow with different Examples.

I will show you two examples; in the first example, the file resides in a SharePoint document library, and in the other example, the file will be in OneDrive for Business.

Here, I have developed an instant cloud flow in Power Automate, and when the flow triggers, it will read the text file content and display it to the user.

Get File Content using Path in Power Automate

Here, I am going to explain two different examples.

In the first example, I have a text file presented in a SharePoint document library. By using get file content using path action for SharePoint, I will show you how to read file content and display the result in the output of the content section.

In the second example, I have a text file presented in the OneDrive library. By using get file content using path action for OneDrive for Business, I will show you how to read file content and display the result in the output of the content section.

Now follow the below steps to create our flow:

Power Automate Get File Content using Path for SharePoint

Let us see how to use Get file content using path action in Power Automate flow.

In this example, we will see how to use Get file content using path action for SharePoint in Power Automate flow; in my Documents library, I have uploaded the text file as highlighted below:

Get file content using path action in Power Automate flow

Step-1:

See also  Power bi measure switch statement with examples

Login to Power Automate Homepage, select the + create option, choose instant cloud flow, enter the flow name, choose the trigger as manual trigger a flow, and click on the create option.

Get file content using path for SharePoint

Step-2:

Add a new step, choose a Get file content using path action for SharePoint from action triggers, and configure the required parameters:

  • Site Address: Select the SharePoint site address from the dropdown where the file exists
  • File Path: From the show picker, select the File for which we want to read the File content.
  • Infer Content Type – Expand show advanced options, By default, the infer content type will be yes, which retrieves the content from the document.
power automate get file content from url

Step-3:

Save and Run the flow by selecting the Run flow option. Once our flow runs successfully, like below:

Expand the get file content using path action; in the output section, we can view the file content values for the selected file,

power automate get file content using path 404

This is how to use Get file content using path action for SharePoint in Power Automate flow.

Power Automate Get File Content using Path for OneDrive

Let us see how to read file content using a path by using the Get File Content flow action for OneDrive for Business in Power Automate flow.

In OneDrive My files, I have uploaded the Text document in the My files library as highlighted below:

get file content using path power automate

Now, we will create a flow of how to read file content using Power Automate flow.

Step-1:

Create an instant cloud flow with the manual trigger. Enter the flow name and click on the create option as highlighted below:

Get file content using path for OneDrive

Step-2:

See also  How to save camera image to SharePoint list attachment in Power Apps

Add a new step, choose a Get file content using path action for OneDrive from action triggers, and configure the required parameters:

  • File Path – Select the File for which you want to read the file content.
  • Infer Content Type – By default, it will be yes. The content type will be retrieved from the document.
Get file content using path action for OneDrive in Power Automate

Step-3:

Save and Run the flow by selecting the Run flow option. Once our flow runs successfully, like below:

Expand the get file content using path action; in the output section, we can view the file content values for the selected file,

Get file content using path action for OneDrive in Power Automate flow

This is how to use the “Get file content using path” flow action to get the file content from OneDrive for business in a Power Automate flow.

Conclusion

I hope you got an idea of how to get file content using a path in Power Automate using the Get File Content flow action. Here, I have done two examples; in the first example, the file is stored in a SharePoint document library, and in the other example, the file is stored in OneDrive for business.

In both cases, once you trigger the flow, it will read the text file content and display it to the user in Power Automate.

You may also like:

>