cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wedge
Advocate I
Advocate I

Simplify Get File Content from SharePoint

I'm trying to setup a sample flow that does file conversion using a third party flow. That part works fine, but the issue I was having was with the "Get file content" (on SharePoint) to send the conversion flow. Most of the references I see online just have an "Identifier" dynamic object in the File Identifier field and it works fine. There is no "Identifier" dynamic object I can see here, but there is an "ID" which I assumed was the same thing:

flow1.png

 

Try this and no. I get a 404 error because "ID" is just a plain number being sent into the field.

 

So just to test if I can reference an explicit file, I used the folder navigation option to select a test file manually instead.


flow2.png

And this works fine! But of course is not at all useful.

 

So I try to replicate this using the dynamic content of the fileName

flow3.png

Nope, no good, I get an 400 Bad Request error this time.

 

So, I peeked at the code underneath both of these, and the only difference was the URI formatting on the file path when I had selected the file manually vs when I had tried to setup a custom filepath. 

 

The manual file selection JSON was:
encodeURIComponent('%252fFinance%2bDocuments%252fTest%2bReport.xls')

The dynamic string was:
encodeURIComponent('/Finance Documents/',triggerBody()?['entity']?['fileName'])

 

So just for kicks, I tried using the URI formatting instead like this:
flow4.png

And voila, now it works!

 

So is there a simpler way to do this that I am missing? Considering I'm working entirely in a Microsoft environment and Automate is (I think?) supposed to be for non-programmers, I thought this would be like a point and click operation.

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User
Super User

Hi!

Power Automate (aka Flow) is sometimes tricky.

Let's see if this post provides you the answer you are looking for.

Hopw this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
efialttes
Super User
Super User

Hi!

Power Automate (aka Flow) is sometimes tricky.

Let's see if this post provides you the answer you are looking for.

Hopw this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



OK I figured out what I was missing from that. I had to add a "Get Item" SharePoint step, which I guess resolves the ID into an "Identifier" dynamic object that slots nicely into the "Get file content" step.

 

Thanks!

It was easy to help since your initial post was explained in such detailed way.

Happy Flowing!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,922)