Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Prevent files from duplicating when automatically moving them into folders

The idea is that I am going to drop a bunch of files into the SharePoint folder, in this case I dropped two 



Then the flow will automatically generate a bunch of folders based on the beginning of the file names and place them into the corresponding folders.



Below are the two folders that are created from dropping the two files. The issue I am experiencing is that all the files are being duplicated in each of the folders when there should only be one file in each of the folders that has the matching name:






What is wrong with my flow below and how can I change it so that only the correct file shows in each of the folders? (Ex. file "J0000-1002_.......PDF" only shows in folder "J0000-1002". Thanks in advance! 







 Let me know if you need clarification on the flow, thanks! 

Super User
Super User

Hey @overhead_press2 


Your screenshots are too small and low resolution, but If I understand correctly you have an apply to each loop - and the create action is inside the loop. Can you try using the Create action outside the "apply to each loop.


If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,547)