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 / The file is created bu...
Power Automate
Answered

The file is created but there is no content and action fails with error File Not Found

(1) ShareShare
ReportReport
Posted on by 331
Hi!
 
So I have been working on a flow with @Tomac that creates a file into another library when one of the columns turns to "Yes".
Everythings run correctly until it comes to the action create file, because it doesn't get the file content of it and when opening it, it's just blank. 
 
I asked in a SharePoint forum because I thought it was an On-Premise SharePoint issue, like it couldn't support it or something but it seems it shouldn't be happenning this.
I couldn't get the file content from "Get File Content" or "Get file content using path".
 
We don't know why is it failing to get the content.
 
Thanks!
Categories:
I have the same question (0)
  • Tomac Profile Picture
    3,950 Moderator on at
    To add a bit more context:
     
    • This environment is using an on-premises connector
    • The file is getting created but without any content (zero bytes file size)
    • The action Create File is failing with the error File Not Found even though it does create a file with no content
     
    The SP user forum suggested encoding the folder path instead of having spaces, the above screenshot shows the file content being encoded instead of the path but that didn't impact the error and issue.
     
     
    This one is out of my depth.
  • chiaraalina Profile Picture
    1,175 on at
     
    Can you share the following:
     
    1. Screenshot of “Get file content” (expanded) with what you put in File Identifier.
    2. Screenshot of your “Compose – FileContent” with expression.
     
    Thanks!
  • Charlie Martharper Profile Picture
    331 on at
     
    The Get file content is using this:
    Tried too with "get file content using path" with path folder + file name with extension.
     
    The file content compose has the same, path folder + file name with extension, but I use that compose inside file content in Create File:
    encodeUriComponent(outputs('FileContent'))
     
     
  • chiaraalina Profile Picture
    1,175 on at
     
    The action "Get file content” with File Identifier = Identifier from the trigger" is done correctly. But you’re also using “Get file content using path”.  You don’t need both. Keep the first.
     
    What to change:
     
    • Delete: Get file content using path
    • Delete the Compose “FileContent” and remove encodeUriComponent() (you don't need that in the create file action)
    • In Create file → File Content, select dynamic content: File Content (from Get file content)
     
    By the way: Where is the condition for to check if it is yes or no?
  • Charlie Martharper Profile Picture
    331 on at
     
    There is no condition, yet, because it was only creating a file with trigger condition when a column in the library changes. So I didn't created the condition if it's created, update the file (+ properties) & delete the other and if it's not created, create the file with the properties.
     
    Whe using your flow, it happens what @Tomac was saying, "resource not found":
     
    We don't know why this happens, because with the other flow the files was being created but it wasn't getting the content.
     
    Once the Create file action runs correctly, I will introduce the condition there. The folder path is right because everything was working fine unless the file content.
     
    The file is created in the library it should be crated, but when opneing the file, in this case a .xlsx, it returns this message:
     
    It cannot open the file because the format or extension is not valid, Check if the file is not famage and the extension matches with the file.
    It is created in the folder I indicate in the folder path, but it doesn't get neither the value properties of the file and the file content
     
    Thanks!
  • chiaraalina Profile Picture
    1,175 on at
     
    Don't pass the whole Body object. Use this expression instead: body('Get_file_content')?['$content']
     
    If you have done all my suggestions, please show again screenshots of the whole flow.
     
    Thank you!
  • Charlie Martharper Profile Picture
    331 on at
     
    It happens the same error when opening the file. Exactly the same. Different File content but same result:
    The flow runs when a column changes in a library, it gets the file content, the terms from the terms guid management storage in the sharepoint, and it creates the files into another library + the properties from another private library.
  • Verified answer
    chiaraalina Profile Picture
    1,175 on at
    Hi
     
    Can you try base64ToBinary(body('Get_file_content')?['$content']) instead of just body('Get_file_content')?['$content'].
     
    Thanks!
     
    Let me know!
  • Charlie Martharper Profile Picture
    331 on at
     
    Perfect! With that I could open the file! 
     
    Thank you so much!!!

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

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard