cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wkeber
Regular Visitor

Get File Content Using Path - Not Found Error

I'm trying to create a simple Flow to convert a document to PDF (from a SPO Document Library) and then email it. (How this isn't OOB functionality for SPO is beyond me and a frustration that I will take out in another venue 🙄)

Anyway, Get File Content Using Path for the SP connector keeps saying my file isn't found, but it is, and I have fought with it enough and am breaking down to ask for help. I can literally copy/paste the passed String into my browser and up pops the file. (Oh, also, I tried Get File Content and it says the ID is invalid so, yep.. idonno.)

Screen Shot 2021-02-08 at 7.06.17 PM.png

PS: if you respond with some variation on "this is a known limitation" it'd be helpful if you please point me to the documentation, because another point of frustration with MS is that documentation seems to be in a dozen different places. And if I can find it (usually with Google's help, ironically) the article never seems to be up-to-date. If I sound frustrated, it's because this simple little Flow should have taken 15 minutes and I'm rounding hour 3! 

1 ACCEPTED SOLUTION

Accepted Solutions
wkeber
Regular Visitor

Solved it - posting as a reply for future reference in case it's helpful to someone else.

Need to use "Get File Properties" after "For A Selected File" because the Dynamic Value "ID" from "For A Selected File" is not the "Identifier" that "Get File Content" wants.

So "Get File Properties" uses "ID" as input, and then you use its output "Identifier" to "Get File Content" and works like a charm.

Screen Shot 2021-02-08 at 9.51.41 PM.png

Entirely unnecessary, imo, because why can't "For A Selected File" just return all the properties for that selected file? BUT more importantly is not referenced anywhere in the documentation for this Connector.

5 hours I will never get back. 😒

View solution in original post

8 REPLIES 8
Pstork1
Dual Super User
Dual Super User

I think your problem is that the path its expecting is not the same one you use in a browser to get the file.  You've already specified the address of the site so the only thing it needs is the path within the site to the document.  You can normally find the in the dynamic content when using a file related trigger.  But its just the simple path from the site.  So if the document is in the Documents library it would be.

/Shared Documents/Filename.docx


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
wkeber
Regular Visitor

@Pstork1 I was thinking the same thing! That string offers a URL with the document preview functionality in SPO. (Which is why I actually started off using the Get File Content action instead..) 

But, alas, switching to only the File Name dynamic content also yields a 404.. 

This:

Screen Shot 2021-02-08 at 8.21.28 PM.png

 Results in this:

Screen Shot 2021-02-08 at 8.21.16 PM.png

 

wkeber
Regular Visitor

Just for comprehensiveness, here's the same issue (404) with the Get File Content action (instead of by URL):

This:

Screen Shot 2021-02-08 at 8.23.51 PM.png

 Results in this:

Screen Shot 2021-02-08 at 8.24.42 PM.png

 

wkeber
Regular Visitor

Solved it - posting as a reply for future reference in case it's helpful to someone else.

Need to use "Get File Properties" after "For A Selected File" because the Dynamic Value "ID" from "For A Selected File" is not the "Identifier" that "Get File Content" wants.

So "Get File Properties" uses "ID" as input, and then you use its output "Identifier" to "Get File Content" and works like a charm.

Screen Shot 2021-02-08 at 9.51.41 PM.png

Entirely unnecessary, imo, because why can't "For A Selected File" just return all the properties for that selected file? BUT more importantly is not referenced anywhere in the documentation for this Connector.

5 hours I will never get back. 😒

Pstork1
Dual Super User
Dual Super User

Two things.

1) As I mentioned in my post just the file name is not the path.  The path includes the file name and the library and folders to get to the file from the root of the site.  That's why file name alone doesn't work.

2) The ID you were trying to use is the Integer ID of the item.  It can be used to retrieve the file properties, but not the content.  Once you have the Properties you can use the Identifier to retrieve the content.  If you look at the Identifier you'll see that it is the library/folder/document path with the special characters encoded.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
Pstork1
Dual Super User
Dual Super User

Just to be clear, it is in the documentation.  Here's a screenshot from the SharePoint connector documentation.

image.png

Notice that it specifies you use the File Identifier to get the contents of the file.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!
wkeber
Regular Visitor

Hi @Pstork1 - first of all let me apologize for being so short/curt yesterday, it wasn't directed at you or your solution, just frustration in general that a seemingly simple task was taking so long. (And I will blame lack of sleep also.) And thank you for your replies!

So, for "Get File Content Using Path" - both of the Dynamic Content options returned by "For A Selected File" result in 404. The itemURL returns a URL and not a path. And the fileName, as you point out, doesn't have the path either. So it seems that we need "Get File Properties" to obtain the full path to pass to "Get File Content Using Path" - which is fine, just unclear (and not intuitive.. I think that's part of why I was stumped.)

Screen Shot 2021-02-09 at 11.38.26 AM.png

Now, moving on to "Get File Content" -- I think this is where I got really frustrated with the documentation. The "For A Selected File" Action returns Dynamic Content called "ID" which is defined as "File Identifier". So, I believe that it is reasonable for the user to assume that this Dynamic Content is the required input for "Get File Content" - as shown here: 

Screen Shot 2021-02-09 at 11.41.32 AM.png

As for documentation, yes, you do correctly point out that the entry for "Get File Properties" notes that its "Identifier" Dynamic Content can be used with Action "Get File Content". In fact, that's how I figured out to add in the "Get File Properties" Action to get my Flow working. But nowhere in the "Get File Content" Action documentation does it say anything about requiring the "Get File Properties" Action in order to obtain the File Identifier input that "Get File Content" is really looking for.

Screen Shot 2021-02-09 at 11.44.50 AM.png

So, when troubleshooting, I don't think folks would think to look at "Get File Properties" as a first resort, thinking to themselves "Well the 'For A Selected File' Action is already returning 'File Identifier' so I'm not looking for additional properties to fix this 404."

Anyway, not that my opinion matters to MS, but I think that the file identifier term should be subdivided to be more granular - e.g., the "For A Selected File" Action output of ID (the Integer ID) should have a more specific, contextual definition, perhaps something like "Library File Identifier" to denote that it's the identifier within the Document Library.

Anyway, thanks again for the replies. Hopefully this thread helps out some other users in the future - cheers! 👍

Pstork1
Dual Super User
Dual Super User

I agree that the description of "File Identifier" for the ID is confusing.  I also suspect its a typo.  If you look at the trigger for "When a file is created or modified (properties only), which is much more common than for a selected file, you can see that there is both an ID and Identifier.  I'm not sure why the Identifier isn't in the Selected file trigger.  Sorry, that you found the process frustrating. Unfortunately, with all the connectors the product is huge and there are some quirks.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

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 (5,383)