How to Troubleshoot Flow Fails on Required Metadata After File Create
🔍 WiseChecker

How to Troubleshoot Flow Fails on Required Metadata After File Create

When you create a file in a SharePoint document library, a Power Automate flow may fail if the library has required metadata columns. The flow attempts to read or update the file before the metadata is saved, causing a timeout or error. This article explains why this happens and gives you step-by-step fixes to resolve the failure.

The root cause is that Power Automate triggers on file creation before SharePoint finishes saving the required metadata. The flow then tries to get file properties or update columns, but the required fields are empty, so the operation fails. You will learn how to delay the flow, use the correct trigger, and handle metadata updates reliably.

By the end of this article, you will be able to configure a flow that waits for metadata to be saved and then updates the file without errors. You will also learn how to test the flow and avoid common pitfalls.

Key Takeaways: Fix Flow Failures on Required Metadata After File Create

  • Power Automate trigger “When a file is created (properties only)”: Fires before metadata is saved, causing failures on required columns.
  • Add a “Delay” action: Wait 30 to 60 seconds after file creation to let metadata save completely.
  • Use “Get file properties” after the delay: Retrieve the latest metadata and then update the file without errors.

ADVERTISEMENT

Why Flow Fails When a File Has Required Metadata

SharePoint document libraries can have columns marked as required. When a user uploads a file, SharePoint prompts the user to fill in those columns before the file is fully saved. However, Power Automate triggers like “When a file is created (properties only)” fire the moment SharePoint registers the file creation event, which happens before the user completes the metadata form. The flow then tries to get or update the file’s properties, but the required columns are empty, causing the flow to fail with errors like “Required field is empty” or “Invalid file metadata.”

The trigger “When a file is created (properties only)” is designed to capture only the file metadata, not the file content. But it still fires before SharePoint finishes writing the metadata to the database. If you use the trigger “When a file is created,” it waits for the file content but still does not wait for required metadata to be saved. This timing gap is the core technical cause of the failure.

The Role of the “Delay” Action

Adding a “Delay” action after the trigger gives SharePoint enough time to complete the metadata save process. The delay should be long enough for the user to fill in the required fields, but not so long that it slows down the flow unnecessarily. A 30-second delay works in most cases, but you can adjust it based on your library’s complexity and user behavior.

Steps to Fix Flow Failures on Required Metadata

Method 1: Add a Delay Action After the Trigger

  1. Open your flow in Power Automate
    Go to make.powerautomate.com, select “My flows,” and click the flow that fails. Click “Edit.”
  2. Insert a “Delay” action
    Click the “+” between the trigger and the next action. Select “Add an action.” Search for “Delay” and choose the “Delay” action from the “Schedule” connector.
  3. Set the delay duration
    In the “Delay” action, set the “Count” to 30 and the “Unit” to “Second.” This pauses the flow for 30 seconds after the file is created.
  4. Add a “Get file properties” action after the delay
    Search for “Get file properties” and select the SharePoint action. Provide the site address and list name. Use the file identifier from the trigger (dynamic content “Identifier”).
  5. Use the file properties for subsequent actions
    Now use the output of “Get file properties” to read the required metadata. This ensures you are working with the completed metadata.
  6. Save and test the flow
    Click “Save” and then “Test.” Upload a file to the library, fill in the required metadata, and verify the flow runs without errors.

Method 2: Use the “When a file is created or modified” Trigger

  1. Change the trigger to “When a file is created or modified”
    In flow edit mode, remove the existing trigger and add “When a file is created or modified” from SharePoint. This trigger fires after the file is fully saved, including metadata.
  2. Add a condition to check if the file is new
    Add a “Condition” action. Use the dynamic content “Trigger Outputs” > “Modified time” and compare it to “Created time.” If they are equal, the file is newly created, not a modification.
  3. Proceed with your actions only for new files
    Place your metadata update actions inside the “If yes” branch of the condition. This prevents the flow from running on every modification.
  4. Save and test
    Save the flow and test it by creating a new file with required metadata. The flow should now trigger only after the metadata is saved.

Method 3: Use a “When a file is created” Trigger with a “Wait for an approval” Workaround

  1. Add a “Wait for an approval” action
    After the trigger, add a “Start and wait for an approval” action. This pauses the flow until the file metadata is manually approved by a user.
  2. Configure the approval
    Set the approval to be sent to the person who created the file or to a library manager. The approval email can include a link to the file.
  3. After approval, get file properties
    Add a “Get file properties” action after the approval. This retrieves the latest metadata, which is now complete.
  4. Complete the flow
    Add your metadata update or other actions. Save and test.

ADVERTISEMENT

If the Flow Still Has Issues After the Main Fix

Flow still fails with “Required field is empty” after adding delay

The delay may be too short. Increase the delay to 60 seconds. If the problem persists, check if the required column is a managed metadata column or a person or group column. These columns sometimes require extra processing time. Also verify that the user is actually filling in the required metadata. If they skip it, the file will still be created but with empty required fields, and the flow will fail. In that case, add a condition to check if the required fields are filled before proceeding.

Flow runs multiple times for the same file

This happens when using the “When a file is created or modified” trigger without the condition check. The flow runs once on creation and again on any metadata update. Add the condition described in Method 2 to limit the flow to new files only. Alternatively, use a “Trigger conditions” setting in the trigger properties to filter by creation time.

Flow fails with “Access denied” error

The flow’s service account may not have permission to read or update the file’s metadata. Go to SharePoint admin center > Access controls and ensure the flow’s connection (usually the owner’s account) has at least “Edit” permissions on the document library. If the library has unique permissions, grant the account directly.

Item When a file is created (properties only) When a file is created or modified
Fires on File creation event before metadata save File creation and any metadata or content modification
Waits for required metadata No Yes, because it triggers after save
Needs a delay workaround Yes, add Delay action No, but needs condition to filter new files
Best use case When you only need the file identifier early When you need to work with complete metadata

You now have three reliable methods to fix flow failures caused by required metadata after file creation. Start by adding a 30-second delay to your existing flow. If the problem continues, switch to the “When a file is created or modified” trigger with a condition. For advanced scenarios, use the approval workaround to manually confirm metadata completion. As a final tip, always test your flow with a file that has all required fields filled to ensure the fix works before rolling it out to users.

ADVERTISEMENT