File not found – The specified file is not found during the flow’s execution

Loading

Power Automate workflows often interact with files stored in SharePoint, OneDrive, Dataverse, Azure Blob Storage, and other cloud storage services. However, sometimes the flow fails to find the specified file, resulting in an error like:

“File not found: The specified file does not exist.”

This guide explains:
Why the “File Not Found” error occurs.
How to diagnose the issue.
How to fix common file retrieval problems.


Step 1: Understanding Common Causes of the “File Not Found” Error

CauseDescription
Incorrect file pathThe file path used in the flow is incorrect.
File was deleted or movedThe file existed but was deleted or relocated before the flow ran.
Filename mismatch (case-sensitive in some systems)The file name may have been changed slightly.
Dynamic content is empty (null value)The trigger did not return a valid file name or path.
Permissions issueThe flow does not have permission to access the file.
File extension missing or incorrectSome services require the correct file extension.
The folder path does not existThe flow is looking for a file in a folder that no longer exists.

Step 2: Diagnosing the Issue

2.1. Check the Flow Run History

  1. Open Power Automate (https://make.powerautomate.com).
  2. Click on My Flows → Select the affected flow.
  3. Go to Run History → Open a failed run.
  4. Look for an error message like: File not found: The specified file does not exist.
  5. Expand the action details to check:
    • File path used by the flow.
    • Dynamic content values (make sure the file path is populated).
    • API response or error details.

Step 3: Fixing Common “File Not Found” Errors

3.1. Fix Incorrect File Path Issues

Problem: The file path provided in the flow is incorrect.

Solution:

  • Double-check the file path. Ensure it includes folders, subfolders, and the correct filename.
  • If using SharePoint, ensure the path includes the document library.

Example: Correct SharePoint Path Format

/Shared Documents/Invoices/Invoice123.pdf

Use absolute paths instead of dynamic paths when possible.


3.2. Handle Files that Were Deleted or Moved

Problem: The file was deleted or moved before the flow executed.

Solution:

  • Check the file location manually in SharePoint, OneDrive, or other storage services.
  • If the file was moved, update the flow to use the new location.
  • If the file is missing, use a condition in Power Automate to check for file existence before proceeding.

Example: Use “Get File Properties” Before Accessing a File

  1. Add a “Get File Properties” action.
  2. Use Condition to check: If "ID" is not empty → Proceed with file actions. Else → Send an email alert.

3.3. Fix Filename Mismatch (Case Sensitivity Issues)

Problem: Some services (like SharePoint and OneDrive) treat file names as case-insensitive, but APIs may be case-sensitive.

Solution:

  • Ensure the filename matches exactly, including capitalization.
  • Use Lowercase or Uppercase Functions in Power Automate to standardize filenames:
toLower(triggerOutputs()?['body/FileName'])

3.4. Handle Dynamic Content Returning Null Values

Problem: The flow’s trigger did not return a valid filename or file path, causing the flow to fail.

Solution:

  • Add a Condition to check if the file path is empty before proceeding.
  • Use a default value when the file path is missing:
coalesce(triggerOutputs()?['body/FilePath'], '/Shared Documents/DefaultFile.pdf')

This prevents errors when a file path is missing or null.


3.5. Fix Permissions Issues

Problem: The flow does not have permission to access the file.

Solution:

  • Ensure the user or service account running the flow has at least Read/Write permissions on the file.
  • If the flow is using a connection, try re-authenticating:
    1. Open Power AutomateData > Connections.
    2. Find the SharePoint or OneDrive connection.
    3. Click Reconnect.

3.6. Ensure the Correct File Extension is Used

Problem: Some flows require a file extension to be included when retrieving files.

Solution:

  • Ensure that the file has the correct extension (e.g., .pdf, .xlsx).
  • If the file extension is missing, append it dynamically:
concat(triggerOutputs()?['body/FileName'], '.pdf')

This ensures that Power Automate searches for the correct file format.


3.7. Ensure the Folder Path Exists

Problem: The flow is looking for a file in a folder that no longer exists.

Solution:

  • Before retrieving a file, use the “List Folder” action to check if the folder exists.
  • If the folder does not exist, create it dynamically before proceeding.

Example: Create a Folder if It Doesn’t Exist

  1. Use “List Folder” to check if the folder exists.
  2. If “Folder Path” is empty, create a new folder before proceeding.

Step 4: Preventing Future “File Not Found” Errors

4.1. Best Practices to Avoid File Retrieval Issues

Use absolute paths instead of relying on dynamic values.
Validate file paths before accessing files.
Ensure the flow has the correct permissions to access storage.
Check if the file exists before performing actions.
Monitor and log missing files instead of allowing the flow to fail.

4.2. Set Up Alerts for Missing Files

  1. Open Power AutomateMy Flows.
  2. Click Edit Flow → Add a “Send an email” action if the file is not found.
  3. Configure the email to alert users about missing files.

Leave a Reply

Your email address will not be published. Required fields are marked *