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
Answered

Get file content using path, file not found 404 error

(1) ShareShare
ReportReport
Posted on by 24
Hey All
 
I have a flow that was working fine up until recently, it's basically gathering form submissions, looping through the attachments, appending to an array and then adding each attachment back to the SharePoint list item that was created
 
however when I'm referencing the item()?['link'] it's not finding any content within it, it's coming back as null, even though the link is present, does anyone have any idea how to fix this issue please?

Categories:
I have the same question (0)
  • StretchFredrik Profile Picture
    3,395 Super User 2025 Season 2 on at
    What output do you get when just typing Item()?
     
    Is the type above just in the post here or also in the flow?
     
    If its in the flow, try putting item()?['link'] instead of item()?['link]
     
  • Suggested answer
    Ellis Karim Profile Picture
    11,684 Super User 2025 Season 2 on at
     
    Please share the flow and configured actions.
     
    In the meantime, here are some things to try:
     
    (1) Try the following expression:
    item()?['{Link}']
     
    (2) This may help:
     
     
     
     
    Ellis Karim
    Ellis Karim
    Blog | LinkedIn | Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!
     
     
     
     
  • AshleyJ17 Profile Picture
    24 on at
    i am putting item()?['link'] apologies that's a typo in the post, i have not changed the flow and it was working as early as 10th June, not whenever its trying to pull data using item()?['link'] i just get a null value as a return from the array
  • AshleyJ17 Profile Picture
    24 on at
    Thanks Ellis, I did read your article yesterday to try and help but still getting errors,

    this is my flow below, so its now getting the link when using item()?['link'] i used your slice and nthindex expression to get the file path but im still getting a file not found error, so looks to be issue is with the Get File Content using path action








  • Suggested answer
    StretchFredrik Profile Picture
    3,395 Super User 2025 Season 2 on at
    I dont think you can use a sourcedoc link for that step, but i might be wrong.
     
    @Expiscornovus actually solved this issue on another forum, ill add some pictures below from that solution.. Hope this helps you!
     
    slice(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['ServerRelativeUrl'], nthindexOf(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['ServerRelativeUrl'], '/', 3))
     
     If my response solved your issue, please mark it as ✅ Accepted Answer and give it a like.
  • AshleyJ17 Profile Picture
    24 on at
    But why was this working up until 2 weeks ago when i have not changed the flow?
  • Verified answer
    Ellis Karim Profile Picture
    11,684 Super User 2025 Season 2 on at
    You need to examine the URL links provided by the Microsoft Forms response because it will determine how we retrieve the uploaded file. URLs seem to vary depending on the file type:
     
    Direct file URL (e.g., PDFs, images, etc.):
    These URLs point directly to the file, allowing us to easily retrieve the file content using the SharePoint “Get file content using path” action.

    Viewing page URL (Doc.aspx) (e.g., for Office documents):
    This is a special SharePoint page URL that is intended to open a file directly within a web browser for viewing or editing, rather than directly linking to the file content. These URLs aren’t compatible with the “Get file content using path” action which requires direct paths to files, not page views. You can quickly identify a viewing page URL because it will include the parameter sourcedoc.
     
     
     
     
     
    Ellis Karim
    Ellis Karim
    Blog | LinkedIn | Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!
     
     
  • AshleyJ17 Profile Picture
    24 on at
    Thanks so much Ellis, this looks to solve the issues up until now the only attachment's have been Jpeg images which is why the flow worked, for now ive restricted the form to only accept PDFs or images whilst i add in the steps from your article
     
    Much Appreciated
  • AshleyJ17 Profile Picture
    24 on at
    Hi Ellis
     
    I have been following your article but getting an error when i get to the Send HTTP Request part, i get the GUID fine but when i pass that into the HTTP Request i get a badgateway 502 error, would you have any suggestions on how to fix this?
     
    "parameters/uri": "_api/web/getfilebyid('%7BF1408855-AD8F-4151-BF8A-EE55997EC7B1%7D\n')/$value"




     
  • Ellis Karim Profile Picture
    11,684 Super User 2025 Season 2 on at
    I noticed the \n (new line character) at the end on the uri:
     
    "parameters/uri": "_api/web/getfilebyid('%7BF1408855-AD8F-4151-BF8A-EE55997EC7B1%7D\n')/$value"
     
     
    In the Compose 4 action, are you accidently adding a blank line, when extracting the file GUID:
     
     
    For PDF docs, you will use the Get file content using path action:
     
     
     
     
     
    Ellis Karim
    Ellis Karim
    Blog | LinkedIn | Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard