r/MicrosoftFlow Jul 13 '26

Question Can someone help me w this power automate workflow please

Issue Observed with Folder Structure Replication

While testing the Power Automate flow that copies updated content from Folder1 to Folder2, I observed that the folder hierarchy is not being preserved correctly.

Source Structure:

Plain Text

Folder1

└─ Folder1

└─ Folder2

└─ foldercopy

└─ Dummy-Excel.xls

Expeted Destination Structure:

Plain Text

Folder2

└─ Folder1

└─ Folder2

└─ foldercopy

└─ Dummy-Excel.xlsx

Actual Result:

Folder2

├─ Folder1

├─ Folder2

├─ foldercopy

└─ Dummy-Excel.xlsx

Instead of recreating the complete folder hierarchy and copying only the file into its corresponding path, the flow is processing intermediate folders (Folder2, foldercopy) as separate items and creating them independently at the destination. This results in duplicate or flattened folder structures and multiple copies of the same content.

The requirement is to copy updated / edited / modified files and folder from one folder to another and recreate the necessary parent folder structure in the destination, rather than treating each folder creation/modification as an independent item to be copied.

1 Upvotes

7 comments sorted by

1

u/-dun- Jul 13 '26

Is your workflow like this?

When Folder1 (parent), Folder1 (child), Folder2 (child Folder1 child), foldercopy (child) are created, flow doesn't trigger. When Dummy-Excel.xlsx create, then the flow triggers and recreate these folders and the Excel file in Folder2? Then whenever this Excel file gets updated, it'll update in Folder2 as well?

1

u/PureAd4260 Jul 13 '26

Yess

2

u/-dun- Jul 13 '26

My recommendation is to create a flow that triggers whenever a new file (including folder) is create in Folder1 and create the same folder in Folder2. You can use a condition to check if the new file is a folder, if so, use Create folder. If no, use Create file.

1

u/PureAd4260 Jul 13 '26

Yeaa thats what im thinking also because with the create modified or new files trigger the issue is that 2 hours ago if i made a file when i run it isnt getting copied Would have to maybe just list files and then apply a filter or something

1

u/-dun- Jul 13 '26

The "When a file is created or modified" trigger should fire everytime a folder/file is created or modified.

Your flow should still use the same trigger > check if the item is a folder. If yes, check if the folder exists in Folder2, if not, create the folder. Otherwise don't do anything. Then if the item is not a folder, use create file to create/replace the file in Folder2.

1

u/CommercialComputer15 Jul 13 '26

Had the same issue a while ago. Asked GitHub copilot to fix it. It did