How to Create a Power Automate Flow to Move Matching SharePoint Files
Question details
The user needs a Power Automate workflow that triggers when a document is saved in SharePoint Folder A, searches for a file with a similar name in Folder B, and moves the matched file into Folder C.
- Product
- Power Automate and SharePoint
- Device & OS
- not provided
- Scenario
- Automating document organization and dynamic file movement across multiple SharePoint directories based on file name matching.
- Observed behavior
- Requires designing specific workflow logic utilizing SharePoint file triggers, name matching queries, and the Move file action.
Ensure you have an active Microsoft 365 subscription with Power Automate access, and verify that you possess Edit or Owner permissions for all involved SharePoint folders (Folders A, B, and C).
Design the Power Automate Flow Logic
Use a combination of SharePoint triggers, file listing actions, and conditions to identify and move matching files. Advanced scenarios may require specialized community support.
To achieve this automated routing, you will need to string together several SharePoint connectors in Power Automate. The core logic involves triggering the flow upon a new file creation, querying the second folder for a matching name, and executing the move action if a match is found.
Go to Power Automate, select 'Create' from the left sidebar, and choose 'Automated cloud flow'. Give your flow a name and select the SharePoint trigger 'When a file is created (properties only)'.
In the trigger action, select your SharePoint Site Address and specify 'Folder A' as the Library Name or Folder path where the initial document will be saved.
Click 'New step', search for 'Get files (properties only)', and add it. Set the Site Address and specify 'Folder B'. Use the Filter Query field to match the file name dynamically (e.g., typing FileLeafRef eq 'TriggerFileName').
Click 'New step' and add a 'Condition' control. Set the condition to check if the length of the retrieved files array from Folder B is greater than 0. This ensures a matching file actually exists before attempting to move it.
Inside the 'If yes' branch of your condition, add the SharePoint 'Move file' action. Use the dynamic content 'Identifier' from the 'Get files' action for the File to Move, and set the Destination File Path to 'Folder C'.
Looking for a Reliable Alternative to Manage Your Documents?
If you find Microsoft Office and its automation tools overly complex or expensive, WPS Office offers a free, lightweight, and highly compatible alternative. You can seamlessly manage your Word, Excel, and PowerPoint files with an intuitive, all-in-one interface.
- 1. Download the installer: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the software: Run the downloaded installer and follow the simple on-screen prompts to complete the setup in just a few minutes.
- 3. Open and manage files: Launch WPS Office and easily drag and drop your existing Microsoft Office files into the workspace to start editing without formatting loss.

Frequently Asked Questions
Why is my Power Automate flow failing to find the matching file in SharePoint?
This usually happens if the Filter Query syntax is incorrect, if the file extensions do not match exactly, or if the flow lacks the appropriate permissions to read Folder B. Ensure your dynamic content correctly represents the file name without hidden characters or extra spaces.
Can I copy the file instead of moving it using Power Automate?
Yes. Instead of using the 'Move file' action in your condition branch, you can select the 'Copy file' action. This will leave the original file intact in Folder B and create a duplicate version in Folder C.
Where can I get specialized help for Power Automate flow errors?
The best place to get expert assistance for complex logic, syntax expressions, and advanced SharePoint integration is the official Microsoft Power Platform Community forums.




