cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
8BitWarrior
Advocate III
Advocate III

Get file content using path works in PowerAutomate but fails when run from PowerApps

I have built a flow that creates a PDF file from some SharePoint online content. The PDF includes an image file that I am storing in OneDrive. 

When I run the flow through Power Automate everything works just fine. When I run the flow through a PowerApp - the flow run fails every time at the "Get file content using path" step where I am specifically getting the image file, with a 404 not found error.  Any ideas?

 

2020-06-18 08_54_10-Run History _ Power Automate.png

1 ACCEPTED SOLUTION

Accepted Solutions

I managed to solve the issue by switching to the 'Get file content' action rather than use the 'Get file content using path' action.

View solution in original post

8 REPLIES 8
JohnAageAnderse
Memorable Member
Memorable Member

Hello @8BitWarrior 

Are there any differences in which account is running the flow? Any differences in permissions to the file then?

Kind regards, John

Hi @JohnAageAnderse 

 

The account that runs the flow in PowerAutomate is different to the one that I am using in the PowerApps. However, I had thought about permissions. And I even granted permissions to that use on the folder and file level. But that did not resolve the issue at hand.

I managed to solve the issue by switching to the 'Get file content' action rather than use the 'Get file content using path' action.

To use get file content you need the Id right and that Id you have to get it from list of files present in folder. Will not add apply to each action?

 

I have same problem but i don't want that apply to each action to be added there, any workaround pls?

Regards,

DML

Hello @DML1 

Use tha action "List files in folder", this will give you all the files (till the limit).

Add a "Filter array" action and filter for the one file that you want. That will give you a one item array of files.

Use an expression to get the Identifier of that single item in the array of files!

Kind regards, John

Hi John,

 

Thanks for your response, it looks like promising. As i am newbee to power automate could you please share some screenshot on this, because whatever i try flow automatically adding apply to each and i dont want that to happen because the email be triggered twice if apply to each added.

 

Thanks in advance.

Hello @DML1 

 

List files in a folder action - do you have that one?

Filter array action - do you have that one?

Use either a Variable action or a Compose action - add in there an expression to get the First item from the Filter array action.

 

Show us what you have so that we better may be able to help you on the way. Kind regards,

John

Thanks for the response and guidance John. 

 

Flow was giving error when followed but done few changes on you suggestion post filter array action.

 

1. List of files in folder

2. filter array - From(Value), condition on file name

3. Select - Body(Filter Array), expression - item()?['Id']

4. Compose - body(Select_Id')?[0]

 

The flow is flawless now. Thank you so once again

 

Regards,

DML

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,674)