web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get File Content Using...
Power Automate
Unanswered

Get File Content Using Path - Not Found Error

(0) ShareShare
ReportReport
Posted on by 43

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! 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    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
  • wkeber Profile Picture
    43 on at

    @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 Profile Picture
    43 on at

    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

     

  • Verified answer
    wkeber Profile Picture
    43 on at

    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 Profile Picture
    68,697 Most Valuable Professional on at

    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.

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    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.

  • wkeber Profile Picture
    43 on at

    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 Profile Picture
    68,697 Most Valuable Professional on at

    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

  • EnochStrok Profile Picture
    57 on at

    Hey @wkeber & @Pstork1 ,

     

    I tried both your methods and because I was trying to not rewrite too much of my flow, I tried @Pstork1 and it worked too. Here is an example of how I got it to work using "path".

    Fixed path.png

  • kmusser Profile Picture
    2 on at

    @EnochStrok 

    I setup a flow this same way and had success UNTIL I took look at the list library items that the files were being attach to. The items displayed the name of the files and linked under "attachments" however, when I clicked to open the files I got error messages that the files (such as..word, pdf, png) couldn't be opened/had issues. The root files in the APPs Form folder where MS Flow was sending and storing the files worked fine.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard